Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Variance parameter estimates in proc mixed

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-21-2013 03:28 PM

Hi all,

I'm new to using proc mixed, and I have a fwe basic questions regarding the output and differences in procedure.

I have a two-level model in order to account for clustering of individual subjects within groups. I am interested in obtaining independent estimates of the **between, within, and total variances** so that I can calculate effect sizes for a trial.

The first question regards the output of the covariance parameters. As all the guidance documents note, I'm seeing two parameters: 1) an intercept parameter that corresponds to the cluster variable I have identified as the "subject" in my random statement; 2) the residual. My understanding is that the intercept is the **between **cluster variance, the residual is the **within **cluster variance, and the **total** variance can be obtained by summing these two. Can someone confirm or deny that? My for this procedure is of the following form:

**proc ****mixed**;

class clustervar;

model outcome = ;

random intercept /subject= clustervar;

**run**;

My second question regards whether it is common practice to include a treatment effect and covariates (or predictors in general) when computing variances or intra-class correlation coefficients (ICC) using proc mixed. I have seen it done with and without the inclusion of such variables in online documentation. My sense is that, if one just wants to get variance or ICC for a particular outcome, you wouldn't model a treatment effect in that calculation. Obviously, the results are quite different using and not predictors. An example code for doing so would be:

**proc ****mixed**;

class clustervar;

model outcome = treatment;

random intercept /subject= clustervar;

**run**;

I appreciate any help anyone can give on this matter. Thanks in advance.

Regards,

Devin Peipert

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-22-2013 11:23 AM

If there are fixed effects in your design, I would certainly include them in the model statement. About the only time I use anything like your first statement is when I am doing Gage R&R calculations.

As fara as calculating the total variance, I tend to shy away from that. Likelihood methods mean that the variance components are not calculated from sums of squares, which are the only things in this context that are truly additive. Total variance will depend on number of clusters and number of subjects within each cluster.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-22-2013 08:55 PM

Hi Steve,

As always, thanks for your quick and helpful repsonse.

One further question that expands upon your warning against summing the intercept and residual covariance parameters The typical formula for an ICC

would be something like the following:

ICC = Sc/Sw+Sc,

where Sc is the between-cluster standard deviation, Sw is the within cluster standard deviation, and Sc + Sw is taken to be the total standard deviation.

Is the a way to get these variance (or sd) components directly from proc mixed? I have been using a macro in SAS that uses proc mixed in the way

described above to get the ICC, and I was under the impression that the sum of the intercept variance and the residual variance was a valid way to get "total

variance" for the purposes of ICC calculation.

Again, your perspective on this would be highly valued.

Thanks,

Devin

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-23-2013 08:18 AM

Hi Devin,

Well, that definition of ICC is certainly widespread in the literature. It is known to be biased away from zero. I just wouldn't call Sw + Sc the "total variance", preferring "sum of variances". But I think that is just me being picky. Without actually doing the calculations, what happens with unequal replication from cluster to cluster, if you calculate my definition of "total" variance (i.e. ignore cluster effects, fixed effects, etc.). I don't think the number will equal Sw + Sc. Anybody else out there got a direct answer for this?

Steve

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-23-2013 10:17 AM

I think the formula is

ICC = Vc/(Vw+Vc), variance not std dev.

also it is important to remember that Vc and Vw are unexplained variances. The only time the denominator (Vw+Vc) approximates total variance is for the empty model. Once predictors are entered, IC becomes the proportion of UNEXPLAINED variance, conditional on the model.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-29-2013 11:17 AM

Thank you both for your replys. Both very helpful.

Regards,

Devin