BookmarkSubscribeRSS Feed
Mattr5541
Calcite | Level 5

Hello all,

I have been attempting to generate ICC analyses for an imputed dataset by using the proc mixed statement detailed below:

 

proc mixed data = e.imputepeappend; by _imputation_;

class admin subid;

model bpedqtot = admin;

random int /sub= subid type = un;

repeated/sub=subid type = sp(pow) (admin) rcorr = 1,2 local ;

parms .56 .13 .5 .13;
ods output CovParms = cov_estimates_pe; run;

 

This appears to generate the results that my colleagues and I are looking for (the variance of bpedqtot across administration timepoints, i.e., admin), but I cannot properly aggregate the covariance parameters of all 50 imputations.  

 

I have been using this code, but I cannot seem to get it to run properly:

 

proc mianalyze data = cov_estimates_pe ; where CovParm = "admin";

modeleffects CovParm subject estimate ; run;

 

And I will receive the following error:

ERROR: The input TYPE= data set is not a valid data set without specifying variables for standard errors in the STDERR statement.

 

From what I understand, the main issue seems to be that I cannot generate results for the standard error, as the mixed model only produces "Cov Parm", "Subject", and "Estimate" values:

(covariance table for imputation 1)

 

Is there any way for me to properly run the proc mianalyze statement without having any standard error values?

 

PS. Sorry if any of my terminology is off, I'm still somewhat inexperienced with SAS and programming in general.

 

3 REPLIES 3
SteveDenham
Jade | Level 19

With admin as a CLASS variable, the example here indicates that you will need the SolutionF dataset output from the BY _imputation fits. PROC MIANALYZE then needs to look like:

 

proc mianalyze parms(classvar=full)=mxparms;
   class admin;
   modeleffects Intercept admin;
run;

This ought to give you the combined parameter estimates for the fixed effects.  If you are looking for the combined estimates of the spatial power estimate, I am at a bit of a loss on what to do. The example here shows how to incorporate the covb matrix.  Note that in both of these, you need the solution vector, so add /solution to your model statement and SolutionF=solutionf to your ODS output statement.

 

One other note: you have admin as a CLASS variable in your PROC MIXED code, but include it in SP(POW)(admin), which so far as I know, requires a continuous input.

 

SteveDenham

 

SAS_Rob
SAS Employee

To combine the covariance parameters in MIANALYZE you would need to do something similar to the example shown below.

 

/*Sample data set assuming MI has already been run*/
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 covtest;
by _imputation_;
class school class;
model y = time / s;
random int / subject=school ;
random int /subject=class(school);
ods output covparms=cvparms;
run;
data cvparms;
set cvparms;
covparm2=covparm||subject;

proc print;
run;

proc sort data=cvparms;
by covparm2 _imputation_;
run;
proc mianalyze data=cvparms;
by covparm2;
modeleffects estimate;
stderr stderr;
run;

Mattr5541
Calcite | Level 5

Great, this solutions seems to work well!

 

I have one more question, though:

 

the mianalyze procedure generates two sets of covariance parameters, one for the intercept of the variable of interest (subid, or more specifically, the variable containing our individual subjects), and one for the Residuals.  Which set do you think would be appropriate for analyzing the proportion of the variance that is associated with between-person--or trait--differences and the proportion that is associated with variations across time points?  We already have an idea of how we're going to calculate this (by using the within/between/total variance), but we're not entirely certain if we should be using the intercept, Residual, or both.

 

And thanks for your help so far 🙂

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 1976 views
  • 1 like
  • 3 in conversation