Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

learn more… | top users | synonyms

0
votes
0answers
2 views

Interpreting random slope for a dataset with missing data in mixed model

I am struggling to understand the meaning of random effect for the dataset with missing data based on mixed model, I am appreciated if anyone can help. Here is an example. let us say we have 20 ...
0
votes
0answers
2 views

Meta-analysis of standard deviation using the `metafor` package in R: can we distinguish between the different types of variability?

I am doing meta-analysis of standard deviations of parameter X (gastric pH). My collated studies are conducted on humans and each study report mean plus/minus SD of gastric pH in the studied ...
0
votes
2answers
432 views

Specifying Dirichlet prior in rjags

I am running the below mixing model using the rjags package in R, but I keep getting the error message ...
3
votes
1answer
23 views

Random effects for second order in R mixed models

I am fitting a mixed effects model in R using nlme lme(y~x+I(x^2),random=~x|subject,data=train) Is this the correct way or should it be ...
3
votes
1answer
14 views

Are parametric tests on rank transformed data equivalent to non-parametric test on raw data?

Many non-parametric tests are identical to their parametric equivalent on ranked data. At least, that's what I learned from this blog post on Friedman's test and skimming this 1981 article.. This ...
0
votes
1answer
24 views

Can this data be fitted with a beta distribution?

Disclaimer: I'm not a statistician but a software engineer. Most of my knowledge in statistics comes from self-education, thus I still have many gaps in understanding concepts that may seem trivial ...
0
votes
0answers
13 views

Estimating Gamma MLE with left truncated data (using R and maxLik)

I'm trying to find the maximum likelihood estimation of the parameters of a Gamma distributed random variable using maxLik. The following code explain what I did: ...
1
vote
0answers
5 views

Interpretation of coefficients in Cox model with time varying covariates and coefficients

I have a data set on survival times for individuals that may or may not develop a disease during the course of the study. Disease status is a time varying covariate, since individuals may become ...
0
votes
0answers
11 views

Controlling for variables with lmer (R)

I am using lmer (from the lme4 R package) on a dataset with 6 variables: SubjectID, ImageID, Category, Brightness, Contrast and ResponseTime, where the last three are continuous variables. (and yes, ...
1
vote
1answer
35 views

Are these diagnostic plots from lmer too far away from normal and showing heteroscedasticity?

I have read similar posts in this website to help me assess whether my diagnostic plots are too far away from normal and if they are showing heteroscedasticity (Interpretation of residuals vs fitted ...
0
votes
0answers
6 views

Is fanny() an extension of cmeans() in R? or are they different? [on hold]

Is fanny() method in R is an extension of cmeans() in R. If I pass a dissimilarity cosine matrix to fanny() function, without passing any value for metric parameter will it perform fuzzy c-means with ...
0
votes
1answer
37 views

taking log of sales when many observations are 0 or close?

I am currently attempting to replicate an Econ paper in R, which claims that they take the natural log of net sales. Many of the observations however are either 0 or very close to 0. What is the ...
0
votes
0answers
19 views

Model Underperforming

I am a quite new to machine learning but I have tried to implement some prediction on a data to predict if a customer would churn of not.And for this I have used many features but I am unable to ...
0
votes
0answers
5 views

I want to create a custom date range in SPSS for Holt Winter's forecasting. Can it be done with a custom start number with a custom periodicity? [on hold]

My custom number starts at 1 and ends at 10, for each of the number, (1 to 10) I have a periodicity of 1 to 9. In SPSS, custom Date option is not providing much help. Again, Winter's additive is ...
1
vote
1answer
134 views

General estimating equation with zero-inflated continuous data in R

I'm running a General Estimating Equation using the geepack package in R. I'm wondering what distribution family would be appropriate for my data, which are zero-inflated and continuous. I would have ...
1
vote
1answer
23 views

Confidence intervals for group means (R)

Here are some sample data in R: set.seed(42) df <- data.frame(g = factor(rep(1:2, each= 50)), y = rnorm(100)+rep(0:1, each=50)) One can easily get group means ...
0
votes
0answers
14 views

the Randomised Complete Block Design

I got the following output using the Randomised Complete Block Design: ...
0
votes
0answers
16 views

info about R in finance and timeseries analysis [on hold]

i'm interesting in R language but i'm not sure if it is what i need. I read lot of articles around the web and seems that R is so used in finance but i 'm still don't know if can be fine for me... ...
1
vote
1answer
13 views

How to interpret the lme function result?

the following is the command I used and the results I got for my question, whether the visitation frequency of my bee is different in different experiment types in different locations. I used the lme ...
1
vote
2answers
25 views

Predict with pseudo-mean factors in new data

R and Stata have different default behaviors when making predictions from a model that uses categorical/factor covariates. For example, if I want to predict outcomes for both levels of a two-level ...
0
votes
1answer
391 views

R code to solve for probability of normal distributions?

I don't understand which R code I am supposed to be using to figure these problems out. I brief explanation of what the code is doing would be amazing. The problems below are two different ...
1
vote
2answers
35 views

What is maximum and its computation in the function dist() {stats} in R?

In R, we can calculate a distance matrix using the method "maximum" in the function dist() in the stats package. ...
172
votes
8answers
160k views

Difference between logit and probit models

What is the difference between Logit and Probit model? I'm more interested here in knowing when to use logistic regression, and when to use Probit. If there is any literature which defines it using ...
1
vote
1answer
123 views

Need to extrapolate missing monthly data from annual data; the monthly/seasonal index is reasonably well-known

I have a revenue dataset for various businesses. For about half of those businesses, monthly data is available. For the other half, only annual revenue data is present. I know the seasonality of the ...
0
votes
0answers
29 views
+50

Cronbach Alpha Assumptions

I'm currently learning ho to use Cronbach Alpha in R. I have a scale with 7 items and 63 respondents. The aim is just to get a practical understanding of what Cronbach Alpha is. There are some nulls ...
0
votes
0answers
16 views

Adding dummies as control variables change the coefficient

It has been difficult to formulate a title for this question. But here is something that is puzzling me. I have an ordinal probit model with a bunch of covariates. One of the covariates is the number ...
0
votes
2answers
24 views

How to get Cox & Snell, Nagelkerke R-Square in R logistic regression output?

I'm new to R (used to work with SPSS), and looking for a function that will output the Cox & Snell and Nagelkerke R-Square measures of logistic regression. In SPSS they are displayed as part of ...
0
votes
0answers
7 views

Dummy coding a column in R with multiple levels [on hold]

I have a dependent variable measuring the net revenue. One of the major predictor affecting this is "product" i.e. the product sold to the customer. My randomly sampled dataset contains 1.4 million ...
0
votes
0answers
11 views

Nested effect in GLM

I am sorry that my question repeats many others already available here. However I have read many of them (e.g. this, this and this) as well as other documents and I am still not sure about my model. ...
0
votes
1answer
11 views

Co-variate contribution to model accuracy in multi-variate analysis

I have implemented a multivariate analysis in R as such: lm1<-lm(Y ~ A + B + C + D + E, data=data, weights = 1/Uncert) I found that the variable A contributes ...
0
votes
1answer
19 views

RJAGS bayesian approach of mixed effects model

Why my posterior result always shows that the sigma and sigma.c estimates to be around 50? It should not be that large as I know from another approach of analysis and also summary of the data. Is it ...
0
votes
0answers
13 views

Pairwise test and random effect for Beta regression

I have percentage areas values from 4 treatments (25 replicates per treatment). I would like to compare these percentages. I am supposed to use a beta regression, because my response variable is a ...
3
votes
0answers
2k views

Non-linear modelling with several variables including a categorical variable

I am trying to model some data regarding a predator prey interaction experiment (n=26). Predation rate is my response variable and I have 4 explanatory variables: predator density (1,2,3,4 5), ...
0
votes
1answer
141 views

R: Trouble using SMOTE package “invalid 'labels'” [on hold]

Using SMOTE package from DMwR library. After loading the data frame, I try to perform sampling as follows : ...
0
votes
0answers
5 views

How to read multiple excel marco enabled files in r [on hold]

I'm very new to r. I'm trying to read 500 odd marcos enabled files in r but i'm getting error as "Error: Skipped over all data". Below code as been used to run the program. files <- ...
0
votes
0answers
6 views

Nearest neighbours approach variant?

Hi i'd like to know a bit more about kNN-like approach implementations for classification problems, and specifically classification problems where we want to have a probability distribution as an ...
0
votes
0answers
10 views

How to find gamma coefficients?

I am trying to replicate this paper "Gleditsch, Kristian Skrede and Michael D. Ward. 2006. "Diffusion and the International Context of Democratization", International Organization 50: 911-933" and I ...
0
votes
0answers
20 views

Stuck while trying to predict on data based on H2O Deep Learning model

I have created an H2O Deep Learning model in R for multi-class classification and I want to use it to perform prediction. I would have assumed that if I use the model to predict on the validation ...
0
votes
0answers
14 views

Support to interpret Performance Metrics from H2O Deep Learning model

Using H2O in R, when I perform the call h2o.performance(m1, dataframe.valid.H2O), the below metrics table is returned. Where can I find explanation of what each row ...
0
votes
0answers
17 views

Support to interpret classification charts from H2O DEEP LEARNING

I have executed H2O Deep Learning (with grid search) on my data-set for multi-class classification and the resulting charts from the first and second best model do not make much sense to me. It seems ...
0
votes
0answers
4 views

R Caret train / rfe optimize for positive predictive value instead of Accuracy or Kappa

In train or rfe I can only set Accuracy or Kappa. Is there a way to edit the functions to define a scoring function? I am using Kappa at the moment but I need to optimize for positive predictive Value ...
0
votes
0answers
26 views

Forecast the profits for the stores in diffrent locations [on hold]

I have data set for stores as below about 700 rows for various store locations and below are columns ...
1
vote
1answer
156 views

Mantel test and Moran I giving different result for same data sample

I want to check spatial correlation for my data about fecal coliform values in water measured at different location. For this I have tried both Moran.I and the Mantel test. They are giving different ...
0
votes
0answers
1 view

Discrepancy measure for bayesian beta model

I fitted a beta model with a vector of Jaccard similarities as response variable and a vector of euclidean distances as predictor variable in JAGS. I coded the model as follows: ...
0
votes
2answers
38 views

R auto.arima with intervention: intervention only affects one point

I have a model fitted with auto.arima, the model is ARIMA(0,1,0)x(0,1,0)[6] with seasonal period 6. The data is bi-monthly so there is an annual seasonality. There ...
1
vote
1answer
21 views

meta-analysis mixed model - polygons based on meta-regression

When using meta-regression with factor moderators, result differ a bit from using seperate estimation based on subgroup, even if the same model (mixed effects) is used for both. I understand the ...
1
vote
0answers
10 views

what does it mean when one of my top ranked model is the null model?

I have some whale tourism data that I am trying to model to see which factors significantly affect the number of encounters between whales and tourists. I have two years worth of data and have ...
0
votes
1answer
150 views

Method to identify the point in which the slope of a predicted probability becomes significant

I'm running a logistic regression in which I'm predicted a binary response from a continuous predictor... I'm interested in determining the exact point in which the predicted probability ...
0
votes
0answers
6 views

How do I do feature selection using Bayesian networks?

I have two classes and a load of high dimensional data and samples, how does one go about selecting features by Bayesian networks? I can find details on how to make the network, but no packages in R ...
2
votes
1answer
304 views

Problems in scale Bayesian network mode using R

The problem that we have is as follows. We have close to 60 discrete random variables each of which shall take on an average of 5 categorical values. We have developed a Bayesian network ...