I am new to this MMRM stats procedure; I need help figuring out certain things.
In my data, I have the 3 subjects who took 3 treatments and records over 3 visits (+ Baseline). I need the following statistics
a. 95% CI for the Means for all the treatments
b. Difference in Means ( between the Drugs and Control)
C. The same stats are presented in (a, b) for overall combined 'Drug treatments' that is 95% CI for 'OVERALL' and difference in Means for 'Overall Vs. Control'. When I include the 'overall' treatment in the procedure, it generates no stats. So, I excluded it from my code to run.
I am not sure, I am using the right method do I need to run the 'Overall" treatment (999) separately or is there any way I can do 'Overall Vs Control" with in the same code.
I output the lsmeans and diffs data sets from the 'PROC MIXED" procedure, but I am unsure how to pull the required information out since there are so many records I couldn't see what value represents which interactions. I appreciate your help.
data have;
input sid$ visit$ visitnum test$ aval base chg pchg treatn treat$;
datalines;
101 Baseline 0.5 blood 20 20 . . 1 Control
101 Visit1 1 blood 30 20 10 50 1 Control
101 Visit2 2 blood 20 20 0 0 1 Control
101 Visit3 3 blood 43 25 18 41.8 2 Control
201 Baseline 0.5 blood 20 20 . . 2 Drug_A
201 Visit1 1 blood 45 25 20 62.5 2 Drug_A
201 Visit2 2 blood 27 20 7 25.9 2 Drug_A
201 Visit3 3 blood 27 20 7 25.9 2 Drug_A
301 Baseline 0.5 blood 20 20 . . 3 Drug_B
301 Visit1 1 blood 50 20 30 60 3 Drug_B
301 Visit2 2 blood 44 20 24 54.5 3 Drug_B
301 Visit3 3 blood 67 25 42 62.7 3 Drug_B
data have1;
set have (in=a) have(in=b where =(treatn ne 1));
if b then do;
treatn =999;
treat = 'Overall';
end;
run;
/*ODS to create the data set containing all the means. */
proc sort data = have1; by test sid visitnum; run;
ods output LSMeans=LSmean1 diffs= mean_df;
proc mixed data=have1;
by test;
where chg ne . and treatn ne 999;
class treatn visitnum sid;
model chg = treatn visitnum treatn*visitnum;
repeated visitnum / subject=sid type=UN;
lsmeans treatn*visitnum/pdiff cl;
run;
With one subject per treatment group, you are going to have a difficult time estimating the things you want to estimate here. Data deficiencies will be a problem in fitting even the simplest of models.
If you can get something to converge without errors or warnings, then if you want to compare the baseline to the average of the two treatment groups, use a CONTRAST or LSMESTIMATE statement to get that test.
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.