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;
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?
I'm not sure what the question is. The model which specifies
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.
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.