BookmarkSubscribeRSS Feed
halladje
Fluorite | Level 6

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 

5 REPLIES 5
SAS_Rob
SAS Employee

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;

halladje
Fluorite | Level 6

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;

SAS_Rob
SAS Employee

You'll need the SOLUTION option on the RANDOM statement

halladje
Fluorite | Level 6

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;

halladje
Fluorite | Level 6

Hi there, 

 

I am still experiencing issues with pooling ICCs. Please let me know if you have any further suggestions. 

 

Thanks so much, 

Jillian 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 817 views
  • 0 likes
  • 2 in conversation