1

I'm following up on this question and this answer. The answer mentions that without having a clear study design, understanding whether the random-effects specified in an lmer() model syntax are CROSSED or NESTED is not possible.

Therefore, in this thread, I want to visually provide a couple of study designs as well as their suggested model syntax (from this blogpost) and learn how the model syntax may match up with the study design in terms of CROSSED or NESTED random-effects defined in them. In the following syntax, tx is a binary treatment indicator (0=control, 1=treatment).

DESIGN 1:

Imagine in a 3-wave, longitudinal study, two therapists both get to deliver the treatment and the control arms of the study to a different set of subjects.

The suggested lmer() model syntax is (Q: How does this model syntax match up with DESIGN 1?):

    lmer(y ~ time * tx +                      ## DON'T RUN
            (time | therapist:subjects) +
            (time * tx || therapist), 
             data = data)

enter image description here

DESIGN 2:

Imagine in a 3-wave, longitudinal study, two therapists both get to deliver ONLY the treatment arm of the study to different subjects. The control arm subjects will NOT meet any therapist at all.

The suggested lmer() model syntax is (Q: How does this model syntax match up with DESIGN 2?):

        lmer(y ~ time * tx +                         ## DON'T RUN         
                   (1 | therapist:subjects) +  
                   (0 + time | therapist:subjects) +
                   (0 + time:tx | therapist) + 
                   (0 + tx | therapist),
                   data = data)

enter image description here

Robert Long
  • 53,316
  • 10
  • 84
  • 148
rnorouzian
  • 3,056
  • 2
  • 16
  • 40

1 Answers1

1
lmer(y ~ time * tx +                      ## DON'T RUN
         (time | therapist:subjects) +
         (time * tx || therapist), 
         data = data)

Q: does this model syntax match up with DESIGN 1 ?

Yes.

In this design, subjects are nested within therapists, so ( ... | therapist:subjects) + ( ... | therapist) matches with the design.

It is worth noting that since subjects are coded uniquely, therapist:subjects is the same as subjects

lmer(y ~ time * tx +                         ## DON'T RUN         
                  (1 | therapist:subjects) +  
                  (0 + time | therapist:subjects) +
                  (0 + time:tx | therapist) + 
                  (0 + tx | therapist),
                  data = data)

Q: does this model syntax match up with DESIGN 2 ?

No.

In this design, subjects are partially nested in therapists, however since therapist is missing from the control group, inclusion of therapist or therapist:subjects will result in the whole control group being dropped from the model, therefore unlike design 1, therapist:subjects is not same as subjects. An appropriate model would be:

lmer(y ~ time * tx + (time * tx | subjects), data = data)

Alternatively, if a dummy therapist was added to the data, for the control group, then a model with the same random intercepts as that for design 1 would be appropriate. The proposed model for design 2 would not make sense in this case because it does not allow for variation attributable to therapist.

Robert Long
  • 53,316
  • 10
  • 84
  • 148
  • Dear Rob, thank you very much for your response. Some clarification questions. First, [**HERE for DESIGN 1**](https://rpsychologist.com/r-guide-longitudinal-lme-lmer#subject-level-randomization-therapist-crossed-effect) (*please scroll down a little*), the linked blogpost uses the term `therapist crossed effect`, is this use of crossed effect different in nature from what you considered? In fact, what is the role of dropping the correlation `(time * tx || therapist)` in DESIGN 1? . . . – rnorouzian Dec 05 '20 at 04:50
  • . . ., [**HERE for DESIGN 2**](https://rpsychologist.com/r-guide-longitudinal-lme-lmer#partially-nested-models) (*please scroll down a little*), do you see any role for the combination of terms to the left of `|` such that they would justify partial nesting or the totality of DESIGN 2 in any way? – rnorouzian Dec 05 '20 at 04:56
  • They seems to be talking about therapist being crossed with treatment. Dropping the correlation might be due to convergence issues or if there is no theoretical justification for the correlation. – Robert Long Dec 05 '20 at 10:56
  • As for design 2, random slopes might be justified on theoretical a priori grounds. That's a matter for domain knowledge. – Robert Long Dec 05 '20 at 10:59
  • Thank you Rob. So, when you say *"They seem to be talking about therapists being CROSSED with treatment"*. You mean that sense of the term crossed doesn't warrant any changes anywhere in the model syntax? Moreover, you don't support this use of the term "CROSSED" (i.e., therapists being CROSSED with treatment)? – rnorouzian Dec 05 '20 at 16:29
  • No in this instance I think they are not talking about crossed random effects so it doesn't affect the model syntax. – Robert Long Dec 05 '20 at 17:13
  • 1
    Rob, thank you so much. Just wanted to mention that the author of the linked blogpost seems to specialize in this area of designs. Maybe it is worth taking a look at his dissertation [**HERE**](https://openarchive.ki.se/xmlui/bitstream/handle/10616/46909/Magnusson_k_thesis.pdf?sequence=1&isAllowed=y) to better understand why he has proposed the model syntax for these designs the way he discusses in his blog. --Once again, many thanks (both upvoted & accepted). – rnorouzian Dec 05 '20 at 17:19