Linked Questions
16 questions linked to/from Have I correctly specified my model in lmer?
239 votes
3 answers
208k views
R's lmer cheat sheet
There's a lot of discussion going on on this forum about the proper way to specify various hierarchical models using lmer. I thought it would be great to have all ...
70 votes
3 answers
153k views
Questions about how random effects are specified in lmer
I recently measured how the meaning of a new word is acquired over repeated exposures (practice: day 1 to day 10) by measuring ERPs (EEGs) when the word was viewed in different contexts. I also ...
19 votes
3 answers
5k views
Interpreting three forms of a "mixed model"
There's a distinction that's tripping me up with mixed models, and I'm wondering if I could get some clarity on it. Let's assume you've got a mixed model of count data. There's a variable you know you ...
11 votes
1 answer
7k views
4 votes
1 answer
3k views
Crossed fixed effects model specification including nesting and repeated measures using glmm in R
Background: I am interested in looking at the effects that Culture, Treatment and Time have ...
8 votes
1 answer
4k views
how to understand random factor and fixed factor interaction?
Let's say I fit this model to the Oats data set lmer(yield ~ Variety + (1|Block/Variety), data=Oats) ...
5 votes
1 answer
7k views
Nesting random effect within fixed effect using lmer() of lme4 in R
Problem I want to fit a model using the R lme4 lmer function, and I'm not sure how to specify a random effect that is nested within a fixed effect. Setup I am applying a ...
4 votes
1 answer
2k views
Nested crossed random effects for repeated measures data
Problem There are two excellent CV posts on specifying crossed effects models (post 1, post 2). The issue I'm trying to wrestle with pertains to part of the answer to post 2, in particular how to ...
0 votes
1 answer
2k views
Mixed model (Multilevel) with two INDEPENDENT Random Effects [lmer]
I like to estimate a mixed model with two Random Effects, that are independent of each other and among themselves. I use Panel data with a nested structure (counties $j$ nested within regions $i$). ...
6 votes
1 answer
1k views
Can a factor be regarded as both random and fixed effect?
I have a question about nested mixed effect model. For example I have species A with different populations; these populations belong to two kinds of habitat types (with or without predators). So I ...
5 votes
1 answer
243 views
is it correct to nest fixed effects within random factors?
In this post @Ben Bolker wrote in his answer that for the interaction between station and day we could write ...
2 votes
1 answer
1k views
Mixed effect modelling with multiple, nested random variable
Goal: comparing pitch (Hz) on three types of words Dependent variable: Hz Fixed predictor variable: word-type, points (measurements taken from five points on each token, to capture Hz change within ...
3 votes
2 answers
285 views
Nested data correction with mixed models
We have collected data from n patients, with each patient having one eye treated and the other untreated. We would like to see if the treated eye progresses differently to the untreated eye using ...
1 vote
0 answers
2k views
How to specify a mixed model in lmer for between-subjects longitudinal study?
I'm struggling to figure out the right model specification for my data. Here's my design: a between-subject longitudinal study, with two Type of participants (...
3 votes
1 answer
214 views
Difference between `fix1 + (1|cluster1)` and `fix1 + (1|fix1:cluster1)` when specifying random intercept using lme4 in R
I see sometimes people using two different ways to specify the random effects when conducting multilevel modelling with lme4 in R. ...