Programming the statistical procedures from SAS

random and repeated options in proc mixed

Reply
New Contributor
Posts: 2

random and repeated options in proc mixed

I am running proc mixed with 1 between factor (group) and 3 within factors (cond, side, time). It is my understanding that the repeated statement can only handle 2 within factors. The following code contains what I've been told is one way to specify the model:

proc mixed;

  class subj group cond side time;

  model resp = group|cond|side|time / ddfm=kr;

  random int cond / subject=subj(group);

  repeated side time / subject=cond*subj(group) type=un@un;

I'm comparing this to what I've done in the past with proc glm as follows:

proc glm;

  class group;

  model y1-y18 = group/nouni;

  repeated cond 3, side 2, time 3/nom;

The proc mixed code works but it doesn't match the proc glm output as well as I'd like (same number of subjects in each group and no missing data). I've run the program where I interchange cond, side and time in the random and repeated statements then compare the fit statistics. My question is does anybody have any other ideas about the random and repeated statements that I could try?

Valued Guide
Valued Guide
Posts: 678

random and repeated options in proc mixed

There are so many issues with repeated measures that it would be very difficult to give you simple advice. The specific experimental layout will decide what model (including random and repeated) statements to use.  But you should know that the approach in GLM is different from the approach in MIXED. There is no direct correspondence of the statistics, etc. You really should do some reading on the topic to become familiar with the issues. A good place to start might be:

http://support.sas.com/rnd/app/papers/mixedglm.pdf

It is dated (a lot of new developments since this was written), but it tells you about some of the major issues. Chapters in the book SAS For Linear Models (by Littell, Stroup, and Freund), 4th edition, should be helpful.

Ask a Question
Discussion stats
  • 1 reply
  • 115 views
  • 0 likes
  • 2 in conversation