(Statistical Engineering, Pharma Product Development Data Sciences, Roche)
2023-03-31
Authors:
Thanks to:
lme4 and lmerTestnlme does not give Satterthwaite adjusted degrees of freedom, has convergence issues, and with emmeans it is only approximateglmmTMB to calculate Satterthwaite adjusted degrees of freedomglmmTMB is always using a random effects representation, we cannot have a real unstructured model (uses \(\sigma = \varepsilon > 0\) trick)TMB) directly - as it is also underlying glmmTMB - but code the exact model we wantC++ using the TMB provided librariesTMBC++ framework for defining objective functions (Rcpp would have been alternative interface)TMB interface and plugged into optimizers{mmrm}emmeans interface for least square means{mmrm} and SASTo run an MMRM model in SAS it is recommended to use either the PROC MIXED or PROC GLM procedures.
Less model assumptions are applied in PROC MIXED, primarily how one treats missingness.
We will compares the PROC MIXED procedure to the {mmrm} package in the following attributes:
Both languages have online documentation of the technical details of the estimation and degrees of freedom methods and the different covariance structures available.
{mmrm}
PROC MIXED
{mmrm} are transparent, compared to PROC MIXED.testthat framework with covr to communicate the testing coverage.Note
The integration tests in {mmrm} are set to a tolerance of 10e^-3 when compared to SAS outputs.
Tip
For users that need more structures, {mmrm} is easily extensible - let us know via feature requests in the GitHub repository.

| Covariance structures | {mmrm} |
PROC MIXED |
|---|---|---|
| Unstructured (Unweighted/Weighted) | X/X | X/X |
| Toeplitz (hetero/homo) | X/X | X/X |
| Compound symmetry (hetero/homo) | X/X | X/X |
| Auto-regressive (hetero/homo) | X/X | X/X |
| Ante-dependence (hetero/homo) | X/X | X |
| Spatial exponential | X | X |
| Covariance estimators | {mmrm} |
PROC MIXED |
|---|---|---|
| Asymptotic | X | X |
| Kenward-Roger | X | X |
| Empirical | X | X |
| Jackknife | X | |
| Bias-Reduced Linearization | X |
| Method | {mmrm} |
PROC MIXED |
|---|---|---|
| Contain | X* | X |
| Between/Within | X* | X |
| Residual | X* | X |
| Satterthwaite | X | X |
| Kenward-Roger | X | X |
| Kenward-Roger (Linear)** | X | X |
*Available through emmeans, and ongoing work in mmrm.
**This is not identical to the KR(Lin) in PROC MIXED.
Contrasts and least square (LS) means estimates are available in mmrm using
mmrm::df_1d, mmrm::df_mdemmeanspairs method)mmrm to emmeansPROC MIXED and mmrm do not adjust for multiplicity, whereas emmeans does.Note
These are comparable to the LSMEANS statement in PROC MIXED.
Other R packages, like nlme, lme4 and glmmTMB can support MMRM analysis. However:
lme4)Satterthwaite and Kenward-Roger degrees of freedom, or Sandwich covariance estimator.mmrm not only supports multiple covariance structure, it also has good efficiency (due to fast implementations in C++)
{mmrm} has small difference from SAS


mmrm is on CRAN - use this as a starting point:mmrm for you! And try it out :-)

