Tuesday, June 10, 2014

Mixed effect Model Repeat Measurement (MMRM) and Random Coefficient Model Using SAS

The clinical trial data presented to us are often in longitudinal format with repeated measurements. For Continuous Endpoints in Longitudinal Clinical Trials, both Mixed effect Model Repeat Measurement (MMRM) and Random Coefficient Model can be used for data analyses.

These two models are very similar, but there are differences. MMRM is used when we compare the treatment difference at the end of the study. Random Coefficient Model is used when we compare the treatment difference in slopes. If SAS mixed model is used, the key difference will be the use of Repeated statement if MMRM model and the use of Random statement if random coefficient model is used.

MMRM

MMRM has been extensively used in the analysis of longitudinal data especially when missing data is a concern and the missing at random (MAR) is assumed.

In a paper by Mallinckrod et al, “Recommendations for the primary analysis of continuous endpoints in longitudinal clinical trials”, the MMRM is recommended over the single imputation methods such as LOCF. The companion slides provided further explanation and how to use MMRM in analysis of longitudinal data.

In a recent paper by Mallinckrod et al (2013), “Recent Developments in the Prevention and Treatment of Missing Data“, the MMRM is again mentioned as one of the preferred method when missing data follow MAR. in this paper, an example was provided and the detail implementation of the MMRM is described as the following:
 “The primary analysis used a restricted maximum likelihood (REML)–based repeated-measures approach. The analyses included the fixed, categorical effects of treatment, investigative site, visit, and treatment-by-visit interaction as well as the continuous, fixed covariates of baseline score and baseline score-by-visit interaction. An unstructured (co)variance structure shared across treatment groups was used to model the within-patient errors. The Kenward-Roger approximation was used to estimate denominator degrees of freedom and adjust standard errors. Analyses were implemented with SAS PROC MIXED.20 The primary comparison was the contrast (difference in least squares mean [LSMEAN]) between treatments at the last visit (week 8).”

For MMRM, if SAS mixed model is used, the sample SAS codes will be like the following:

If time variable is continuous (as covariate):
 
proc mixed;
            class subject treatment site;
             model Y  = baseline treatment site
                                treatment*time baseline*time/ddfm=kr;
             repeated time /  sub = subject type = un;
             lsmeans treatment / cl diff at time = t1;
             lsmeans treatment / cl diff at time = t2;
             lsmeans treatment / cl diff at time = tx….;
             run;
Where the treatment difference is obtained with lsmean statement for the treatment difference at time tx.

If time variable is categorical (in class statement):

proc mixed;
            class subject treatment time site;
             model Y  = baseline treatment time site
                                treatment*time baseline*time/ddfm=kr;
             repeated time /  sub = subject type = un;
             lsmeans treatment*time /slice=time  cl ;
             estimate 'treatment difference at tx' treatment -1 1
                                                                      treatment * time 0 0 0 0 -1
                                                                                                 0 0 0 0 1/cl;
          
 run;

The estimate statement depends on the levels of treatment and time variables. Refer to "Examples of writing CONTRAST and ESTIMATE statements in SAS Proc Mixed".

Random Coefficient Model

A longitudinal model using the RANDOM statement is called random coefficient model because the regression coefficients for one or more covariates are assumed to be a random sample from some population of possible coefficients. Random coefficient models may also be called hierarchical linear models or multi-level model and are useful for highly unbalanced data with many repeated measurements per subject. In random coefficient models, the fixed effect parameter estimates represent the expected values of the population of intercept and slopes. The random effects for intercept represent the difference between the intercept for the ith subject and the overall intercept. The random effects for slope represent the difference between the slope for the ith subject and the overall slope. SAS documents provided an example of using random coefficient model


If we intent to compare the differences in slopes between two treatment groups, the MMRM model above can be rewritten as:

proc mixed;
            class subject treatment site;
             model Y  = baseline treatment time site
                                treatment*time baseline*time/ddfm=kr;
             random intercept time /  sub = subject type = un;
            ESTIMATE ‘SLOPE, TRT’ TIME 1 TIME*TREAT 1 0/CL;
            ESTIMATE ‘SLOPE, PLACEBO’ TIME 1 TIME*TREAT 0 1/CL;
            ESTIMATE ‘SLOPE DIFF & CI’ TIME*TREAT 1 -1 /CL;
run;

From the model, the estimate statement is used to obtain the difference in slopes between two treatment groups. In some case, the main effect (treatment) may not be significant, but the interaction term (treatment * time), a reflection of the difference in two slopes, may be statistically significant.


In a paper by Dirksen et al (2009) Exploring the role of CT densitometry: a randomised study of augmentation therapy in α1-antitrypsin deficiency, the random coefficient model was employed to obtain the differences in slopes between two treatment groups:
"In Methods 1 and 2 for the densitometric analysis, treatment differences (Prolastin® versus placebo) were tested by linear regression on time of PD15 measurement in a random coefficient regression model as follows. Method 1: TLC-adjusted PD15 from CT scan as the dependent variable; treatment, centre and treatment by time interaction as the fixed effects; and intercept and time as the random effects. Method 2: PD15 from CT scan as the dependent variable; treatment, centre and treatment by time interaction as the fixed effects; logarithm of TLV as a time-dependent covariate; and intercept and time as the random effects. The estimated mean slope for each treatment group represented the rate of lung density change with respect to time. The tested treatment difference was the estimated difference in slope between the two groups, considered to be equivalent to the difference in the rates of emphysema progression."

3 comments:

Unknown said...

When time variable is continuous (as covariate),why class statement have time variable and model statement have no time variable? Thank you.

Redman said...

Thanks for the explanation.

I was wondering if the random coefficients model would also be a good way to handle missing data, just like how the MMRM would.

Redman said...

Thanks for the explanation.

I was wondering if the random coefficients model would also be a good way to handle missing data, just like how the MMRM would.