4
$\begingroup$

I want to fit a mixed model for repeated measures (mmrm) on a set of panel data with 6 visits and N = 1200. I want to estimate the effect of time passing on the outcome, without any intervention since it's a panel study. So I wanted to fit the model using the mmrm package. It went well and the estimates are looking good and reasonable. But I wonder if mmrm have to satisfy the same assumptions as other random effects models (linearity, normality of residuals, homogeneity of variance and independence of errors afaik) and if my code for the model is correct.

If all the assumptions have to be met how do I do that using R? How to handle a violation of the assumptions?

I chose an autoregressive structure since the correlation of the timepoints should decline over time.

Here is the code:

mmrm_model <- mmrm(outcome ~ sex + age + education + time + ar1(time|subject_id),
                   method = "Kenward-Roger",
                   data = data)
emmeans.mmrm <- emmeans::emmeans(mmrm_model, specs = "time")

Thank you very much for your advice!

$\endgroup$

2 Answers 2

1
$\begingroup$

thanks for your question, I just found it by chance - I would recommend considering posting questions specifically on mmrm in the corresponding GitHub issues page here: https://github.com/openpharma/mmrm/issues since we will see that much more easily in the developer team.

Regarding your question, yes there are definitely a couple of modeling assumptions here in MMRM. In particular linearity in the covariates (but you could use spline or quadratic/cubic terms), normality of residuals, but not homogeneity of variance (because we can have a different variance for each of the visits) and independence of errors only between subjects, but not within subjects and between time points (because here we assume they are correlated).

It is useful to fit an MMRM with an unstructured covariance model first, and then do a comparison with models that have less parameters and assume more structure (such as AR1).

Does this help? Cheers Daniel

$\endgroup$
1
  • 1
    $\begingroup$ Thank you so much Daniel, this is very helpful! By the way, I love the package and the documentation, since it's super intuitive and straightforward. $\endgroup$
    – Lea
    Commented Jul 31 at 9:41
4
$\begingroup$

I know that your question is about assumptions, and these are always important. However, I would suggest that before you start interrogating assumptions based on a final model, you should determine whether your model choice is appropriate. Specifically, you are choosing to run a model that does not account for between-subject differences in initial outcome or in the changes in the outcome over time. This can certainly be a valid approach, but you have the ability to compare such a model with other models that account for this potential source of dependence.

If you switch over to nlme and the lme() command specifically, you can run these various models and use model comparison tests and fit statistics to arbitrate which of the models are most appropriate for your data. It could be, for example, that even after accounting for within-person carryover in the outcome (the residual ar1 covariance structure), that between-subject outcome differences are sizeable and remain.

# Equivalent to your mmrm
m1 <- lme(outcome ~ sex + age + education + time, correlation=corAR1,form=~time|subject_id,data=data)

# Add random intercept that additionally allows for between patient differences in the outcome
m2 <- lme(outcome ~ sex + age + education + time, random=~1|subject_id, correlation=corAR1,form=~time|subject_id,data=data)

# Add random slope that allows for between patient differences in the rate of change in the outcome
m3 <- lme(outcome ~ sex + age + education + time, random=~time|subject_id, correlation=corAR1,form=~time|subject_id,data=data)

# Compare models using Chi-sq testing and inspect fit indices (AIC, BIC)
anova(m1, m2, m3) 
$\endgroup$
3
  • 3
    $\begingroup$ Nice answer Erik (+1) but I thought the mmrm package used by the OP can fit all the models that you have suggested. And, isn't the model specified by the OP ,(mmrm(outcome ~ sex + age + education + time + ar1(time|subject_id), the same as your 3rd model ? $\endgroup$ Commented May 16 at 10:59
  • $\begingroup$ I don't think m3 is the same as the mmrm() model specified by the OP. I am basing that on the mmrm documentation, specifically openpharma.github.io/mmrm/latest-tag/articles/… $\endgroup$
    – Erik Ruzek
    Commented May 16 at 12:45
  • 1
    $\begingroup$ Correct, the mmrm package does not allow for random effects. $\endgroup$ Commented Jul 4 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.