BookmarkSubscribeRSS Feed
yiferic
Calcite | Level 5
Let's say I'm working on a model for human height. There's two groups, one eating a control diet and another eating a supplemented diet. The heights of the individuals are tracked as they age (longitudinal). I use proc mixed with something like

height = age diet;
random personID;

Is this significantly from

height = age diet;
random intercept age diet /sub=personID;

Also can anyone give me insight as to when it would be better to model this as repeated measurements or as random sampling from a population?
4 REPLIES 4
Dale
Pyrite | Level 9
I'm not sure what the question is. The model which specifies

random personID;

fits a model with a random intercept term, whereas the model which specifies

random intercept age diet / sub=personID;

fits a model in which each person has their own age slope and their own diet slope. Are you wondering if the model with person-specific age and diet slope effects produces a model which has better fit to the data, then you could use a likelihood ratio test.

Note that this second model would only seem to be valid if each person was observed on multiple diets. If each person receives only a single diet, then there would be no data that would allow you to compute a person-specific diet slope effect. Also, if each person receives only a single diet, then the subject effect should be nested within diet.
yiferic
Calcite | Level 5
Aahh, not thinking straight,

I meant to ask is

random personID the same as
random intercept sub=personID;

Thanks Dale
Dale
Pyrite | Level 9
Syntax with

random personID;

or

random intercept / sub=personID;

should produce the same log-likelihood and identical random effect variance estimates. I would note that while the results should be identical, the two models are parameterized differently. Because the models are parameterized differently, round-off errors could conceivably produce different results for the alternate syntaxes. If you were to observe any difference in results, such differences should be quite small.

The second form in which you use a subject specification is generally more efficient in use of computer resources. I typically recommend use of the "random intercept / sub=personID;" form.
yiferic
Calcite | Level 5
Thanks Dale!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 1635 views
  • 0 likes
  • 2 in conversation