sas >> How do you calculate Eta Squared using Proc Mixed?

by hodab » Thu, 17 Feb 2005 01:56:34 GMT

Hi all:

I have computed a repeated measures multilevel models analysis in SAS
using Proc mixed on some EMA data.
It was a pretty simple analysis looking at the degree of association
between two variables: mood and pain with time as the repeated measure.
Well, the editor of the journal I am sending the article to would like
me to report effect sizes for the analysis. I know how to get SAS to
print out a 95% confidence interval in Proc Mixed, but I cannot get it
to print out the Type III Sums of Squares that I would need to
calculate Eta squared. My problem, is that Proc Mixed uses MLE and
does not calculate Type III SS. My understanding is that you can get
it to calculate them if you put in a "Method = Type 3" statement, but,
because I have a repeated models analysis and am already using the
"REPEATED" statement, I cannot do both. Do you know any way for me to
get SAS to calculate Eta Squared? If not, do you think that reporting
the confidence interval along with the p value would be sufficient?

sas >> How do you calculate Eta Squared using Proc Mixed?

by stringplayer_2 » Thu, 17 Feb 2005 03:36:05 GMT

What covariance structure is fit by your REPEATED statement. If
you have a TYPE=CS covariance structure, then you can use an
equivalent RANDOM statement. The following two models produce
identical results:

proc mixed data=mydata;
class id time;
model pain = mood / s;
repeated time / subject=id type=cs;

proc mixed data=mydata;
class id;
model pain = mood / s;
random id;

You could specify method=type3 to the latter model to get the
variance partitioning that you need to construct eta.

Alternatively, you can fit the model with and without mood.
Each produces an estimate of the residual variance. If we have

V1=residual variance from model without mood
V2=residual variance from model with mood

then an estimate of eta would be 1 - (V2/V1).



Dale McLerran
Fred Hutchinson Cancer Research Center
Ph: (206) 667-2926
Fax: (206) 667-5977

Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

sas >> How do you calculate Eta Squared using Proc Mixed?

by hodab » Thu, 17 Feb 2005 06:23:37 GMT

Dale -

Thanks so much for your help! It worked! :-)

take care,


Hoda Badr, Ph.D.
The University of Texas M. D. Anderson Cancer Center

Similar Threads

1. how to calculate sum of squares for treatments when using proc mixed

2. how to calculate sum of squares for treatments when using

3. score chi-square & wald chi-square in logistic regression using sas

4. r-squared in proc mixed

Hello List,

My questin regards calculating an r-squared value for a mixed model. From the archives of this list (14 June 2002, subject: Re: Proc Mixed) and the literature (Feng et al. 2001. Annu. Rev. Public Health 22:167-187), my understanding is that to get an estimate of the fixed variation accounted for by a mixed model, I must hold the random components constant using a parms statement.
The code for the model I am fitting is:

proc mixed data=mydata;
     class SUBJ TREAT;
     model conv=temp TREAT / s cl;
     random intercept / subject=SUBJ;
     repeated / subject=SUBJ type=sp(pow)(hours);

From this model, I get the covariance parameter estimates:


and then fit the null model with the covariance parameters set:

proc mixed data=mydata;
     class SUBJ TREAT;
     model conv=            / s cl;
     random intercept / subject=SUBJ;
     repeated / subject=SUBJ type=sp(pow)(hours);
     parms (0.1292) (-0.7550) (5330) / hold=1,2;

And then would calculate r-squared as:

(residual of null model)-(residual of the full model)/(residual of the null model)

This should give me the proportion of the fixed effects variability accounted for by treatment and temperature in the full model. Is this correct? Also, when running this code, the parameter value for the random intercept does not remain constant, any thoughts on this?
Thanks for your input.

Have a good day,


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

5. proc mixed / Latin squares+ repeated measures

6. R square in proc mixed?

Hi all.

How can I obtain R square in proc mixed or maybe something similar
such that I can use in order to know how much variability is explained
by the mixed model?

Have a good day. Many thanks in advance.

7. Using proc freq : add column after doing freq

8. proc mianalyze the random effect of null model using proc mixed

Dear List:

I am using proc mi, proc mixed, and proc mianalyze to analyze my data considering the uncertainty of the missingness. After getting the multiple imputed data sets I started the null model using the proc mixed. I got the results of the null model. But I could not run the proc mianalyze on the random effects of the null model to synthesize the results. It keeps saying the var is not in the parm dataset. I am wondering if someone in this list can shed some lights on this. I think I probably missed some syntax but could not figure out. The following is my sas codes:

/*null model*/
proc mixed data=miout1 noclprint covtest;
class d1;
model v1=/solution;
random intercept/s sub=d1;
by _imputation_;
ods output solutionF=fixedeffects Covparms=randomeffect;

/*synthesize the fixedeffects for the null models*/
PROC MIAnalyze PARMS=fixedeffects;
modeleffects intercept;

/*synthesize the randomeffects for the null models*/
PROC MIAnalyze parms=randomeffect;
modeleffects covparm;

Thanks very much in advance,