Help using Base SAS procedures

R2 values in proc glm for a mixed model

Posts: 0

R2 values in proc glm for a mixed model

This is a follow up post question regarding R2 values in Proc Mixed. I figured out that I have to do this in Proc GLM using the sum of squares for various effects. My question now is how do I account for the different random statements? I am conducting an analysis of a univariate randomized block design in Proc Mixed with repeated measures. I want to make inferences at three different spatial scales so I incorporate three random statements with different subjects. I am using the following code

proc mixed data=xsect method=reml;
class Treatment Site Year CrossSection;
model depth= Year Treatment Site*Treatment/ddfm=kr solution residual outp=residuals;
random intercept/subject=site;
random intercept/subject=treatment*site;
random intercept/subject=crosssection(treatment*site);
repeated Year/ subject=crosssection(treatment*site) type=ar(1) r rcorr;
parms /nobound;

For the first level of inference, I only enable the first random statement line. As I change my level of inference, I include the second and then the third random statement lines.

In Proc GLM I compute the SS using

proc GLM data=xsect;
class Treatment Site Year CrossSection;
model depth= site Treatment Year Year*treatment year*site*treatment;

To calculate R2 for the entire model, I would think I would use Type III values

(SStreatment + SSyear + SSyear*treatment)/((SStreatment + SSyear + SSyear*treatment + SSyear*site*treatment).

However, I don't think this accounts for the different levels of inference indicated in the Proc Mixed random statements.

What can I do in Proc GLM that accounts for this?

Ask a Question
Discussion stats
  • 0 replies
  • 1 in conversation