2
$\begingroup$

I have a longitudinal mixed-effects regression comparing change in depression between two timepoints across 12 groups. I'd like to know if the control group is significantly less effective in reducing depression than the average of the other 11 groups. The model to compare each group to each other looks like this:

m1_phq9 <- lmer(phq9_score ~ time * group + (1|pid),data=df)

Would this solution work?

df<- df %>% mutate(passive_vs_all=ifelse(group=='passive','trout','active') %>% factor %>% fct_rev())

m2_phq9_all_vs_passive <- lmer(phq9_score ~ time * passive_vs_all + (1|group/pid),data=mega_alltimes)

I'd appreciate any insights on setting up the contrast for this kind of model in R.

$\endgroup$
2
  • $\begingroup$ Why do you have 12 groups? That seems like a lot of comparisons, and it may be important to understand why all of them need to be tested against each other here if your principle concern is the control group. $\endgroup$ Commented Nov 4 at 0:41
  • 1
    $\begingroup$ It's a megastudy (AKA intervention tournament) comparing 12 interventions. I'm interested in all the comparisons between the interventions, but just to be super thorough I'm trying to answer, "are these supposedly active interventions as a whole actually better than a passive control?" More info on the project here just in case you're curious! sites.northwestern.edu/10minutechallenge $\endgroup$
    – Benji
    Commented Nov 5 at 0:52

1 Answer 1

1
$\begingroup$

I think your method will probably work, but it is most streamlined to use a downstream package such as emmeans to compute contrasts (see the relevant vignette via vignette("comparisons", package = "emmeans"), particularly section 4); I think the following code will probably work, assuming your control group is the first level of the factor:

em <- emmeans(m1_phq9, specs = ~group)
contrast(em, list(ctrl.vs.all = c(-1, rep(1/11, 11)))

i.e. you want to compute the estimated value/CIs/p-value etc. of

$$ -\mu_1 + \frac{\mu_2 + \dots + \mu_{12}}{11} = \bar\mu_{2:12} - \mu_1 $$

You'll get a warning about "Results may be misleading due to involvement in interactions". This is a fundamental interpretational problem — among-group comparisons will depend on the baseline used, and if the interaction is too large it may just not make sense to do a simple comparison across groups ... However, while you shouldn't proceed unthinkingly, you can mitigate this problem (comparisons across groups depend on the baseline time used for the comparison) by making sure that (1) you're using sum-to-zero contrasts (e.g. set options(contrasts = c("contr.sum", "contr.poly")) before fitting the model) and (2) that all continuous predictors have their zero reference level in a sensible place (e.g., mean-center them). See e.g. Schielzeth 2010 Methods in Ecology and Evolution ...

$\endgroup$
1
  • $\begingroup$ Thanks for the response, Ben. I ran your code but got the warning, NOTE: Results may be misleading due to involvement in interactions. Would you revise your code at all considering the interaction between group and time? To describe the data a bit more, participants indicate depressive symptoms at baseline and a four-week follow-up. $\endgroup$
    – Benji
    Commented Nov 5 at 0: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.