I am modeling change over time in group psychotherapy subjects using R and lme4. My data have the following structure:
My first two-level model with random slopes and intercepts works well and is simple:
lmer(outcome ~ time * treatment + (time | subject), data=data, REML=FALSE)
Now I was wondering if I should use a three-level partially nested model because the group psychotherapy subjects are nested within therapist (there where several therapist providing the treatment), but controls were non-nested. I am guessing I should account at least for main effects of therapists as argued by De Jong, Moerbeek & Van der Leeden (2010).
De Jong, K., Moerbeek, M., & Van der Leeden, R. (2010). A priori power analysis in longitudinal three-level multilevel models: an example with therapist effects. Psychotherapy Research, 20(3), 273-284.
I have found a very useful resource in the following link under "Partially nested models": http://rpsychologist.com/r-guide-longitudinal-lme-lmer
The author gives the following code for a model virtually identical to the one I would like to test:
lmer(outcome ~ time * treatment + (1 | group:subject) + (0 + time | therapist:subject) + (0 + time:treatment | group) + (0 + treatment | group), data=data)
The data he presents is virtually identical but he adds in the model the "group" variable. I don't understand why this is because treatment/control grouping is the same as treatment/nontreatment grouping. If a subject received treatment than he is in the experimental group, if not he in the control group. How would you write this three-level partially nested model? I know this is more a question for Crossvalidated forum, I posted it there with no response and I really feel confused. Thank you.
Keep it simple. Just add a dummy therapist none
to the subjects without therapist. Then fit the model below.
lmer(outcome ~ time * treatment + (time | therapist/subject), data=data)
therapist none
is confounded with treatment waiting list
. Therapist is a random effect and thus penalised. Treatment is a fixed effect and not penalised. Hence all information will go to the treatment effect for waiting list
and the therapist effect for none
will be zero.