Help using Base SAS procedures

R2 values in proc glm for a mixed model

Reply
N/A
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;
run;

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

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?

Thanks,
Ask a Question
Discussion stats
  • 0 replies
  • 130 views
  • 0 likes
  • 1 in conversation