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 the information in one place. A couple of questions to start:
- How to specify multiple levels, where one group is nested within the other.: is it
(1|group1:group2)
or(1+group1|group2)
? - What's the difference between
(~1 + ....)
and(1 | ...)
) and(0 | ...)
etc.? - How to specify group-level interactions?
Basically any thoughts are welcome.