A basic question regarding mixed-models (study design and code provided) Maybe this is too simple a question, but 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 (see the study design below).
My goal is to be able to generalize beyond the therapists and subjects in my study. So, I take both therapists and subjects to be just a random sample of what I like to have in my study.
Question: Even though my random units are therapists and subjects, in the following model syntax (using R's lme4 package) why we take the slopes of time and time * tx (tx is a binary treatment indicator (0=control, 1=treatment)) to be random?
In other words, how do random slopes for time among subjects and random slopes for time * tx among therapists help us generalize beyond therapists and subjects as 2 grouping variables?
 lmer(y ~ time * tx +                      ## DON'T RUN
         (time | subjects) +
         (time * tx | therapists), 
          data = data)


 A: This question is a bit strange because you are asking why the author decided on the model that they did. I would have thought that they would explain that for themselves in their blog/paper/thesis. The best we can do is guess.
Anyway the first thing I would say about this study design is that there are insufficient therapists for treating therapist as a grouping factor for random intercepts.

My goal is to be able to generalize beyond the therapists and subjects in my study. So, I take both therapists and subjects to be just a random sample of what I expect.

That is OK, but with only 2 therapists any generalisation is going to be suspect.
As for why it was chosen to model the data in this way:

how do random slopes for time among subjects and random slopes for time * tx among therapists help us generalize beyond therapists and subjects as 2 grouping variables?

I don't think it directly helps to fit random slopes. It's a modelling choice based on theoretical/domain knowledge. We can come at this from both sides. On the one hand, I usually prefer model parsimony ove specifying as many random slopes as the data will allow. Adopting a "maximal" approach can very easily lead too overfitting. On the other hand, why would we expect each subject to respond to the treatment in the same way ? This is a very good question, and unless we have good reasons, the starting point should perhaps be to include random slopes for treatment, time and their interaction for subjects, as has been done here.
