BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Alan68022
Fluorite | Level 6

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

View solution in original post

7 REPLIES 7
Alan68022
Fluorite | Level 6

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;

SteveDenham
Jade | Level 19

That looks like it should work.  Alternatively, you could fit a Kronecker product (UN@CS, UN@AR(1), UN@UN) with eye and week as the factors and animal as the  subject.  For repeated in time, I would start with UN@AR(1) as the UN@UN may exceed your memory limits.

 

SteveDenham

Alan68022
Fluorite | Level 6

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?

SteveDenham
Jade | Level 19

It does.  That model is one we have used with pretty good success for safety studies with opthalmic drug administration.

 

SteveDenham

Alan68022
Fluorite | Level 6

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

SteveDenham
Jade | Level 19

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

Alan68022
Fluorite | Level 6

Thanks Steve!

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
  • 7 replies
  • 1832 views
  • 0 likes
  • 2 in conversation