Programming the statistical procedures from SAS

how to correctly fit a repeated measure model

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

how to correctly fit a repeated measure model

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


Accepted Solutions
Solution
‎11-19-2013 10:24 AM
Respected Advisor
Posts: 2,655

Re: how to correctly fit a repeated measure model

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

View solution in original post


All Replies
Solution
‎11-19-2013 10:24 AM
Respected Advisor
Posts: 2,655

Re: how to correctly fit a repeated measure model

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

Contributor
Posts: 25

Re: how to correctly fit a repeated measure model

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.

Respected Advisor
Posts: 2,655

Re: how to correctly fit a repeated measure model

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

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 288 views
  • 0 likes
  • 2 in conversation