Hi,
We are testing the effect of two main factors (factor Diet: A or B) (factor: Drug C or D) and their interaction and have some missing data. There are 4 different groups: AC, AD, BC, BD. In order to be able to select the best covariance structure we are including the repeated statement with the option TYPE= un (or cs, ar(1)) to look at the lowest AIC. But we don't know if we should include a SUB = ID since we are not using repeated measures on the same subjects. Our code is like this:
proc mixed DATA=df;
class ID Diet Drug ;
model outcome = Diet|Drug;
repeated /type=ar(1) sub=ID;
lsmeans Diet|Drug/adjust=tukey;
run;
Is the "sub" option necessary?
Thank you!
Yes. There are some minor differences in syntax between MIXED and GLIMMIX, but you can certainly fit a random intercept model with GLIMMIX.
SteveDenham
This is a situation where identification of the experimental/observational unit is critical. In other words, what gets repeated, and at what level? If the unit receives all treatments at some point, then there is a time element, which may be completely confounded with the other fixed effects. In that case, a subject=ID statement enables you to separate variability within subject from that which is between subjects.
If a unit only receives one of the treatments, then I don't see the repeated nature. In that case, perhaps a RANDOM effect can be applied, but I don't understand the design well enough to know if that is the case.
SteveDenham
Hello, thank you for your answer. The design is a two by two. Each unit receives a different treatment. This outcome is not repeated. Only measured at the end of the experiment. Is it correct just to add the random statement like we did below?
proc mixed DATA=df;
class ID Diet Drug ;
model outcome = Diet|Drug;
random /type=ar(1) sub=ID;
lsmeans Diet|Drug/adjust=tukey;
run;
Thank you!
I think the random statement should look like this:
random intercept/subject=id;
You need some effect to actually be random, and the random intercept model is the first to consider, given your design.
I removed type=ar(1) as that assumes there is some ordering to the subjects. I believe you only need a single variance component, so I dropped the type= option.
SteveDenham
Thank you very much for your response and explanation. I was wondering if the random intercept model can also be applied to proc glimmix when the study design is the same?
Yes. There are some minor differences in syntax between MIXED and GLIMMIX, but you can certainly fit a random intercept model with GLIMMIX.
SteveDenham
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.