BookmarkSubscribeRSS Feed
stat2
Calcite | Level 5

I am using SAS Enterprise Guide and need to calculate the intraclass correlation for a mixed model with repeated subjects. In this scenario, I don't have access to BASE SAS, since I am running analysis on a very tightly controlled virtual reality desktop. When I run PROC HPMIXED, the results only give me the residual covariance and not the covariance for both the residual and subject. If I switch covariance types, I get rid of this issue, but the ICC is close to 100%, which is wrong. Is there a way to fix this without switching the covariance type?

 

Here is my code with dataset and variable names edited:

 

proc hpmixed data=dataset;

class id year var1 ;

model measure = var1-var24 / solution;

repeated year / subject = id type=vc;

run;

 

Here is my current output (numbers made up for illustration):

 

CovParm      Subject     Estimate

Residual                        0.003324

 

This is my desired output (numbers made up for illustration):

 

CovParm      Subject      Estimate

VC                id               0.000891

Residual                         0.002511

3 REPLIES 3
stat2
Calcite | Level 5

Thanks. I updated my response. Let me know if you need more information.

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Excellent update with details! Thank you. In the future, just add a new entry in the thread rather than editing a previous entry, so that all the previous information is still available.

 

TYPE=VC cannot produce a partitioning of variances for computation of ICC. Because TYPE=CS is not available for the REPEATED statement in HPMIXED, I would consider this code:

 

 

proc hpmixed data=dataset;
class id year var1 ;
model measure = var1-var24 / solution;
random intercept / subject = id;
run;

 

 

I would think that you would have the MIXED procedure available to you in Enterprise Guide, and that you would not necessarily need the "large problem" features of HPMIXED. If so, these two syntax variations produce the same result:

 

 

proc mixed data=dataset;
   class id year var1;
   model measure= var1-var24;
   repeated year / type=cs subject=id r rcorr; /* Note that RCORR reports ICC */
run;

proc mixed data=dataset;
   class id year var1;
   model measure= var1-var24;
   random intercept / subject=id;
run;

 

 

 

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 3 replies
  • 1560 views
  • 0 likes
  • 2 in conversation