Questions tagged [random-effects]
238 questions
0
votes
1 answer
Making the syntax for random part of a mixed-model in lme4 shorter
I was wondering if there might be a more concise way to write the syntax for the random part of the syntax as indicated below?
PS.: Essentially, I'm trying to get 2 uncorrelated set of random slopes for each level of my binary predictor lb_wght (see…

rnorouzian
- 7,397
- 5
- 27
- 72
0
votes
1 answer
Why I can't include country dummies in my fixed effects model?
First of all I build the following dataframe (country_Id as factor variable and year as numeric):
mydata = pdata.frame(mydata, index = c("country_Id","year"),row.names = TRUE)
Then I check it with:
index(mydata) …

vap
- 1
0
votes
0 answers
Questions about how random effects are specified in lmer
I want to write a random effect model for this regression :
randeffect<- lmer(effort~bs+bso+fe+st+maj+exp+hw+(randomeslope/randomgroupe))
I am beginner in r and actually don't know which code even lmer is useful for random effect model or not,…

Marzieh Karimi
- 71
- 8
0
votes
1 answer
Lme4: error on random effect when looping glmer
I am trying to run a loop of mixed effect models on a large number of variables.
Below, I have tested the model structure on a null model and a model with one predictor variable, and these ran with no errors or warnings
## Null model
df_m0 <-…

bellbyrne
- 67
- 7
0
votes
1 answer
GAMM with scaled t-distribution: Why do my residuals and fitted values not add up to the observed values?
Edit: I have by now figured out that this issue - if it is one - has to do with the fact that I have chosen a scaled t-distribution for my model. Running the model with the Gaussian distribuation doesn't result in the same problem.
Nonetheless, I am…

Clemens
- 39
- 6
0
votes
0 answers
Subject-specific age at peak velocity from linear mixed natural spline model with spline random effects
I am using a linear mixed effects model with a natural spline function for age to describe the trajectory of an outcome y (measured in grams) across time (age in years) in a sample of individuals. My model includes random-effects for splines (with…

aelhak
- 441
- 4
- 14
0
votes
0 answers
The bias of the PQL estimation for GLMM
Hi I recently run into the problem of GLMM estimation, specifically, the bias of the variance components (and the fixed-effects) estimation using the PQL method. Two key references are Brewlow&Clayton 1993 and Lin&Breslow 1995, which both claims…

Jason Luo
- 3
- 1
- 5
0
votes
0 answers
Correct model in R with lmer
I have a question about using linear mixed model effects in R using lmer.
I have a repeated measure experiment with 117 participants. They all perform a task with 5 categories (Prime_Names). The dependent variable is reaction times (Score). I want…
0
votes
1 answer
Problem combining ranef plots of two models with grid.arrange()
I have two LMEs:
lme1 <- lmer(F1 ~ (phoneme|individual) + (1|word) + frequency,
data = nurse_female)
lme2 <- lmer(F2 ~ (phoneme|individual) + (1|word) +
frequency + age + (1|zduration),
data = nurse_female)
I…

Tomikichi
- 47
- 1
- 5
0
votes
1 answer
paste formula together as.formula parse problem
I'm trying to paste a formula together to run in a model but I run into problems when I try to incorporate the random-effects. I want to define the random-effects separately and then add to the formula.
Simple working example without…

user63230
- 4,095
- 21
- 43
0
votes
1 answer
Where is the "Corr" column for my lmer summary under "Random effects?"
I'm using the lmer package to build a model and want to check for correlations between random effects.
First I build a tibble:
id <- rep(1:6, each=4)
group <- rep(c("A","B"), each=12)
type <- rep(c("pencil", "pencil", "pen", "pen"), times=6)
color…

v8289
- 1
- 1
0
votes
1 answer
Continuous variable as a random effect? (lme function in R)
The hormone levels are inflated by the sample mass, even after correcting hormone levels by sample mass (its a common problem for endocrinologists).
I'm trying to determine if treatment affect hormone levels, ''correcting'' for sample…

Carla
- 1
- 1
0
votes
1 answer
Possible to calculate predicted probabilities for each random effect level?
I've run a generalized linear mixed model with a binomial distribution with success of taking a seed as the response (Yes/No). Individual id is a random effect. Is it possible to not just calculate predicted probabilities based on the fixed effects…

Rachael
- 33
- 7
0
votes
1 answer
Random Effects Estimator in plm: system is computationally singular
Again, I'm getting an error that I don't know how to solve when attempting to create a random effects model of my panel data in plm. The code I use:…

Hannah Salamon
- 31
- 2
0
votes
1 answer
R: programming nested random effect in gamm (gamcova)
I am trying to execute nested random effects in R with the mgcv::gamm function. Specifically, this function is supposedly an extension of ANCOVA to GAMM, resulting in a GAMMCOVA.
The reasoning for random effects: the entire dataset is composed of…

ecology
- 606
- 3
- 9
- 29