BookmarkSubscribeRSS Feed
sumiko417
New User | Level 1

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:

  1. When using PROC MIXED, is it preferable to use numeric or character variables in the CLASS statement?

  2. 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

1 REPLY 1
Ksharp
Super User
Maybe the reference level is different for this kind of scenario. Try REF= option:
class usubjid trt01pn(ref='1') avisitn(ref='1') ;
class usubjid trt01p(ref='Placebo') avisitn(ref='Week1') ;

About your questions:
"When using PROC MIXED, is it preferable to use numeric or character variables in the CLASS statement?"
No. I don't think so. Both could be accepted . The different thing might be the reference level of CLASS variable.

"Does the sorting order of class variables affect the analysis results?"
Yes. that might lead to the different reference level, you can make some data to test it is right or not.
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
  • 1 reply
  • 80 views
  • 0 likes
  • 2 in conversation