Hello there,
I have done multilevel multiple imputation and I am running a 3-level model using GLIMMIX. I have ran and pooled my results using PROC MIANALYZE but this only prints fixed effects and I am wondering if there is a way to print random effects i.e. the random intercepts for level 2 and level 3 so I can calculate the associated pooled ICC?
Thanks in advance,
Jillian
You can also us MIANALYZE to combine the random effects as well. You would have to do something like the example below.
data hlm3;
seedval = 9273448;
do _imputation_=1 to 3;
do school = 1 to 5;
call rannor(seedval,usi);
call rannor(seedval,ust);
do class = 1 to 3;
call rannor(seedval,uci);
call rannor(seedval,uct);
do pupil = 1 to 10;
call rannor(seedval,upi);
call rannor(seedval,upt);
do time = 1 to 3;
call rannor(seedval,e);
y = 1 + usi + uci + upi +
time*(1 + ust + uct + upt) + e;
output;
end;
end;
end;
end;end;
run;
proc mixed data=hlm3;
by _imputation_;
class school;
model y = time / s;
random int time / subject=school solution;;
ods output solutionr=rparms(rename=(stderrpred=stderr));
run;
/*Skip this step and remove the BY statement if you do not have*/
/*the SUBJECT= option on the RANDOM statement*/
proc sort data=rparms;
by school _imputation_;
run;
proc mianalyze parms=rparms;
by school;
modeleffects intercept time;
run;
Thanks for the suggestion! I tried using your suggested code and the rparms dataset was not created.
This is the code I used - let me know your thoughts:
proc glimmix data=fullblimp noclprint method=rspl noclprint ;
class x_idschool x_class_id ;
model ov=
/CL dist=normal link=identity solution cl;
by _imputation_;
random intercept/subject=x_idschool type=VC;
random intercept/subject=x_class_ID (x_idschool) Type=VC;
ods output solutionr=rparms(rename=(stderrpred=stderr));
run;
quit;
proc sort data=rparms; by _imputation_ x_idschool x_class_ID;run;
proc mianalyze parms=rparms;
by x_idschool x_class_ID;
modeleffects intercept;
run;
You'll need the SOLUTION option on the RANDOM statement
Still running into errors - let me know if you see an issue with the code.
Thanks so much!
input:
**ICCS*;
proc glimmix data=fullblimp noclprint method=rspl noclprint ;
class x_idschool x_class_id ;
model ov=
/CL dist=normal link=identity solution cl;
by _imputation_;
random intercept/subject=x_idschool type=VC solution;
random intercept/subject=x_class_ID (x_idschool) Type=VC solution;
ods output solutionr=rparms(rename=(stderrpred=stderr));
run;
quit;
proc sort data=rparms; by _imputation_ x_idschool x_class_ID;run;
proc mianalyze parms=rparms;
by x_idschool x_class_ID;
modeleffects intercept;
run;
output:
proc sort data=rparms; by _imputation_ x_idschool x_class_ID;run;
ERROR: Variable X_IDSCHOOL not found.
ERROR: Variable X_CLASS_ID not found.
proc mianalyze parms=rparms;
40 by x_idschool x_class_ID;
ERROR: Variable X_IDSCHOOL not found.
ERROR: Variable X_CLASS_ID not found.
41 modeleffects intercept;
42 run;
Hi there,
I am still experiencing issues with pooling ICCs. Please let me know if you have any further suggestions.
Thanks so much,
Jillian
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.