Programming the statistical procedures from SAS

Mixed models and r²s

Posts: 1

Mixed models and r²s

Hi all,

I've been struggling over my data analysis for a while and was hoping you could give me a hand...

I'm running PROC MIXED because I have non-independent data.  I have multiple data points from each of my experimental units, however, due to the nature of my study, I do not have replicates of my treatments.

My SAS code is as follows:

proc mixed covtest data=AIC IC method=ML;

class stream;

model X = Y / s  ddfm=kenwardrogers;

Random intercept /subject=subject;


I have 2 main questions: 

1. Since I do not have replication of treatments, is it valid to have the subject in the random statement as there is no way to differentiate between subject and treatment?  My understanding of what I have done is not treat subjects a random effect, but rather just told SAS that my X points are not independent, but grouped by subjects and the Kenward-Rogers DDFM will adjust my df accordingly.

2.  Can anyone explain to me in layman's terms how to extract marginal R2s from these models?  I have read a number of papers (e.g. Nakagawa 2013, Snijders and Bosker 1994, etc) but I can't seem to grasp exactly how, and the papers giving macros all use 3 models (null, reduced, full), while I can only create null and full models.  If you could tell me the parameters to use from the SAS output and provide any citations for your info that would be very much appreciated.



Respected Advisor
Posts: 2,655

Re: Mixed models and r²s

Point 1.  When you say you have multiple data points from each experimental unit, are these related in either time or space?  If so, that might change the approach.  However, for now, I would fit the data much as you have, except to change subject=subject to subject=stream.

Point 2. You can form null, reduced and full models.  Null would be

model x=;

Reduced would be:

model x=y;

Full would include the random effect as well.

If that does not give you what I think you are asking for, please post more details about the macros.

Steve Denham

Message was edited by: Steve Denham

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation