Skip to content
Prev 315597 / 398503 Next

Nesting fixed factors in lme4 package

Martina Ozan <martina_ozan <at> hotmail.com> writes:
In general mixed model questions should go to 
r-sig-mixed-models at r-project.org , but this is actually *not*
specifically a mixed model problem.  If A and B are fixed factors,
you're typically interested in A*B, which translates to 1+A+B+A:B,
i.e. intercept; main effects of A and of B; and the interaction.
The nesting syntax A/B translates to 1 + A + A:B, i.e. no main
effect of B.  Nesting would typically make more sense in a random-effects
context where the meaning of "B=1 in unit A=1" is different from
"B=1 in unit A=2", i.e. where you don't want or it doesn't make
sense to estimate a main effect of B across levels of A.

  Ben Bolker