[R-sig-ME] cross-classified models

Malcolm Fairbrother m@lcolm@f@irbrother @ending from umu@@e
Sun Jul 22 13:40:57 CEST 2018


Hi Peter,

Yes, cross-classification is no problem for lme4. The package will determine automatically that your data are cross-classified, assuming you use unique identifiers for each classification. For a random intercept null model (with a normally distributed outcome), you might want something like:

mod1 <- lmer(y ~ 1 + (1 | student) + (1 | teacher), data = yourdataframe)

Hope that helps,

Malcolm



> Date: Fri, 20 Jul 2018 09:27:05 -0500
> From: Peter Paprzycki <peter.paprzycki using gmail.com>
> To: r-sig-mixed-models using r-project.org
> Subject: [R-sig-ME] cross-classified models
> 
> I was wondering if the lme4 package can handle so called cross-classified
> models. Let's say the hypothetical data set up is the following:
> 
> Level 1: observations/data at time 0,1,2
> Level 2: students cross-classified by teachers (student has a different
> teacher in each observation, 0,1,2). HLM 7 program follows the convention
> of a row-by-column cross classification.
> 
> Would anyone hint to what the syntax in lme4 would look like (assuming
> random-intercept model, no covariates/null model).
> 
> Peter



More information about the R-sig-mixed-models mailing list