Hi,
I have a question regarding MMRM analysis using PROC MIXED. Suppose I fit the following model:
proc mixed data=input;
by imputenm;
class usubjid trt01pn avisitn;
model chg = trt01pn avisitn trt01pn*avisitn;
repeated avisitn / type=un subject=usubjid;
lsmeans trt01pn|avisitn / pdiff cl;
run;When using this model, I noticed differences in the results depending on whether I use trt01p versus trt01pn, and avisit versus avisitn. In the dataset, trt01p and trt01pn have a one-to-one correspondence, as do avisit and avisitn. All variables are sorted prior to fitting the model.
This leads to the following general questions:
When using PROC MIXED, is it preferable to use numeric or character variables in the CLASS statement?
Does the sorting order of class variables affect the analysis results?
For example, avisit is a character variable with values such as "Week 1", "Week 2", …, "Week 13". When sorted alphabetically, the order becomes "Week 1", "Week 10", …, "Week 9". Could this impact the model results or interpretation?
Thanks
In general, it does not matter if your class variables are numeric or class variables, as long as the order remains the same between these two types of coding of your values.
The different results you are seeing are probably caused by different sorting order between avisit and avisitn. The TYPE=UN structure is formed based on the order of the repeated effect, avisit or avisitn, week1, week10,... for avisit has different sorting orders from 1, 2, 3,...13, therefore the covariance parameter estimates would be different between the two approaches.
I hope this helps,
Jill
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.