Suppose we have repeated observations on pupils, where pupils are nested within schools. In lme4
I believe the correct way to specify the random effects part of the formula is
(1|School/Pupil)
which expands to
(1|School) + (1|School:Pupil)
My questions are:
- What exactly is the
:
symbol doing in the formula ? Does it make this an interaction term, as per the usual way that R works or is it something else ? - What would be the interpretation of a formula which only contains
(1|School:Pupil)
? - What would be the interpretation of a model specified as
(1|School) + (1|Pupil) + (1|School:Pupil)
Best Answer
:
is the interaction operator. For example it is specifically mentioned as such in the lme4: Mixed-effects modeling with R book draft by D. Bates (see Sect. 2.2.1.1 on Nested Factors)(1|schools)+(1|school:pupil)
), you have intercept variations only among pupils within schools. It is a rather restrictive model and I think is hard to justify because you would expect at least some minimal effect to be due toschool
as a factor.school
,pupil
andschool:pupil
; which I think is a bit of a tall order for not exceptionally large and well-behaved samples.