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

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?
Thanks!

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

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;
run;

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

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).

HTH,

Dale

=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: XXXX@XXXXX.COM
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------

__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

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

Dale -

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

take care,

hoda

___________________
The University of Texas M. D. Anderson Cancer Center
email: XXXX@XXXXX.COM
____________________

```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);
run;

From this model, I get the covariance parameter estimates:

intercept=0.1292
sp(pow)=-0.7550
residual=0.5330

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;
run;

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?

Have a good day,

KA

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

```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.
```

```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;
run;

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

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