Hi! Am looking for some help with programming an MMRM model with subsampling. We have a repeated measures model where there is a subjectID, week (as the repeated time of collecting response), age, sex, and a treatment (active vs pbo). We first analyzed a response endpoint (change from baseline) where the response was measured once per subject at each timepoint. The code is:
proc mixed data=final;
class trt Week subject_id sex;
model change = age sex baseline Week trt trt*Week/ddfm=kenwardroger;
repeated Week/subject=subject_id type=un;
lsmeans trt trt*Week/pdiff cl;
run;
This worked great to get the p-val needed for active vs placebo at the last week. But we have another response variable that is measured twice at each week, one measurement for each eye. We have a variable which is left eye or right eye for each time point. So eye is nested within subject. We want a p-value for active vs placebo at the last week. We've tried different ways to specify this using proc mixed but not with any success. Can someone help?
A separate random statement with a subject may improve the model fit, or it may lead to the G matrix being non-positive definite. It is one of those things you have to run to see what happens. We use this random effect when the covariance structure has some sort of autoregressive formulation (i.e. not for CS, CSH, UN, CHOL).
SteveDenham
Could this be right? Note that while we keep track of measurements are for the right eye and left eye, we are interested in the treatment effect for all eyes, regardless of left or right.
proc mixed data=final;
class trt Week eye subject_id dmsex;
model change = age sex baseval Week trt trt*week/ddfm=kenwardroger;
repeated Week/subject=eye(subject_id) type=un;
lsmeans trt trt*Week/pdiff cl;
run;
Thanks Steve. It works (with a simpler variance matrix) but I've also tried it with:
random subject_id;
Should I include this random statement when eyes are nested?
Also, when the eyes are labeled as worst affected eye and least affected eye (by the underlying disease) where we are interested in knowing if the treatment helps differently between the two, I'm thinking that eye label is then a factor in the model and is no longer nested. We would have
proc mixed data=final;
class trt Week subject_id sex eyelabel;
model change = age sex baseline eyelable|trt|week /ddfm=kenwardroger;
repeated Week/subject=subject_id type=un;
lsmeans eyelable|trt|week /pdiff cl;
run;
Does this seem right to you?
It does. That model is one we have used with pretty good success for safety studies with opthalmic drug administration.
SteveDenham
Thanks again Steve!
One last thing, with the nested model where eye(subject) is in the repeated statement, should we still have subject in a random statement?
Alan
A separate random statement with a subject may improve the model fit, or it may lead to the G matrix being non-positive definite. It is one of those things you have to run to see what happens. We use this random effect when the covariance structure has some sort of autoregressive formulation (i.e. not for CS, CSH, UN, CHOL).
SteveDenham
Thanks Steve!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.