Hello:
I want to fit a repeated measure model using proc mixed but got confused by the appropriate way of writing down the model. Using the sample dataset pr in the SAS document
SAS/STAT(R) 9.2 User's Guide, Second Edition
The sample code in the above link proposes to use repeated statement directly
proc mixed data=pr method=ml covtest;
class Person Gender;
model y = Gender Age Gender*Age / s;
repeated / type=un subject=Person r;
run;
which assumes measures within each subjects are correlated. However, I have seen in many places that people use random effects to fit a repeated measure model. In this case, something like
proc mixed data=pr method=ml covtest;
class Person Gender;
model y = Gender Age Gender*Age / s;
random person / v;
run;
The within subject correlation is modelled by introducing a random effect for each subject over different time point. The two model yields different results and I am not sure which one is correct. The data itself looks like a typical repeated measure without any special structure. If both models are valid (I bet they are), what are the assumptions in those two models and how can I decide which one to use if I am given a new dataset?
Thanks,
Peter
Your first model assumes that measures within a person, at each time point, are related as expressed by the unstructured covariance matrix. This R side formulation is the more standard approach, expecially for things like growth models (as the example given). The G side model that you present ignores the correlation between time points, and calculates a variance component due to person. This is sometimes referred to as a random intercept model.
You should look at SAS for Mixed Models, 2nd ed. by Littell et al, and at Generalized Linear Mixed Models by Stroup for some really good insights into model selection.
Steve Denham
Your first model assumes that measures within a person, at each time point, are related as expressed by the unstructured covariance matrix. This R side formulation is the more standard approach, expecially for things like growth models (as the example given). The G side model that you present ignores the correlation between time points, and calculates a variance component due to person. This is sometimes referred to as a random intercept model.
You should look at SAS for Mixed Models, 2nd ed. by Littell et al, and at Generalized Linear Mixed Models by Stroup for some really good insights into model selection.
Steve Denham
Thanks Steve. I assume the first model is more general and would allow more general correlation structure whereas the second model enforces a positive within subject correlation.
I would call the second model more general, as it imposes no structure on the observations, assuming that they are randomly distributed, and that only the subject (person in this case) contributes variation above the residual variance. The R side model (second model) enforces some sort of structure/correlation on the observations within a subject.
Steve Denham
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.