I'm doing a mixed linear model. And I have subjects who have been select in 20 schools. So I want to take this to account.
For this, I want to put a random intercept for the "SCHOOL" variable and a random intercept and slope for my "SUBJECT". But I want to take into account the nested effect.
Does this code fit the nested model:
lme(Y ~ T + X, random = list(SCHOOL = ~ 1, SUBJECT = ~ T), method = "ML")
T is the time, and
Y the outcome.