libname data "C:\Documents and Settings\ejohnson\My Documents\MultilevelModels"; ** Variance component model; proc mixed data=data.popular; class school; model popular = / solution; random intercept / subject = school;run; ** Sex is included as a random effect and teacher experience (texp) as a fixed effect; proc mixed data=data.popular; class school; model popular = texp sex / solution; random intercept sex / subject=school type=un; * NOTE: the estimated variances are labeled according to their; * order in the random statement; * So UN(1,1) is the random intercept, UN(2,2) is the random sex effect; run; * Generate an interaction of sex with teachers experience; data data; set data.popular; gxt = sex*texp; run; proc mixed data=data; class school; model popular = texp sex gxt / solution; random intercept sex / subject=school type=un; run;