Programming the statistical procedures from SAS

Indicate More than One Level of Nesting in PROC MIXED

Reply
Contributor
Posts: 20

Indicate More than One Level of Nesting in PROC MIXED

Could someone verify that the way to indicate more than one level of nesting is to follow the variable name with all the variables within which it is nested within parentheses?

variable1(variable2 variable3)

For example, if you have prior and current year test scores of students who are nested within classrooms which are nested within schools which are nested within districts, you can model the current score using the prior score while accounting for random effects at the classroom, school, and district level by the following code:

proc mixed data=... ;
class classroom school district;
model current = prior ;
random intercept / type=un sub=district s;
random intercept / type=un sub=school(district) ;
random intercept / type=un sub=classroom(school district) ;
run;
Ask a Question
Discussion stats
  • 0 replies
  • 120 views
  • 0 likes
  • 1 in conversation