I am using the lmer()
function (lme4
package) in R for analysing a longitudinal study in which I measured 120 subjects, 6 times. In first instance, I specified a model like this:
library(lme4)
model1 = lmer(DV ~ 1 + X1*X2 + (1+X1|SubjectID), REML="false")
X1
is a time-varying variable (level-1) and X2
is a subject-level variable (level-2).
Because these subjects are nested within several teams, I was advised to include a random intercept at the team-level (level-3). However, I only find how to include both random intercept and slope:
model2 = lmer(DV ~ 1 + X1*X2 + (1+X1|TeamID/SubjectID), REML="false")
Does anyone know how to add only a level-3 random intercept to model 1?