Skip to content
Prev 1350 / 20628 Next

help with a cross-classified random effects model code in R.

Dear Dr. Bates,
You replied to a question by Violet(Shu) Xu on how to estimate
cross-classified (XC) models. In the DIGEST version however, no example
code is provided.
In general, how do we estimate XC models using lme4?

Is the following example for a null model for some dependent variable Y
for pupils who attended specific primary and secondary schools correct?
Or does lmer then estimate a nested model?

lmer(Y~(1|primaryschool)+(1|secondaryschool),data=dataname)

Kind regards,
Stijn Ruiter