My data look like this: The dependent variable is score on a language task (numerical). I have $2$ between subject variables:

  1. age (young vs old: categorical)
  2. language (monolingual vs. bilingual: categorical)

Then, I have $3$ within-subject variables (task conditions):

  1. verb type (2 values: categorical)
  2. focus (2 values: categorical)
  3. definiteness (2 values: categorical)

There are two random effects:

  1. subject
  2. item

I run an lmer model in R. I want to include random intercepts and random slopes.

Question: Does it make sense to include random slopes for within-subject (so verbtype, focus and definiteness) factors for RE subject and random slopes for between-subject factor (so age and language) for RE item?

If yes, the model would look like this, so all factors as random slopes for both random effects:

lmer(score ~ age * language * verbtype * focus * definiteness + 
             (1+age+language+verbtype+focus+definiteness|subject) + 

Intuitively, I feel like it does not make sense to include between-subject factors (age and language) as random slopes for subject and between-item factors (verbtype, focus and definiteness) as random slopes for item. If this intuition is correct, the model would be:

lmer(score ~ age * language * verbtype * focus * definiteness + 
             (1+verbtype+focus+definiteness|subject) + (1+age+language|item), 

Which one of these models makes more sense?

  • $\begingroup$ +1. Your intuition is correct. The second model is correct (assuming that all three within-subject factors are between-item). $\endgroup$
    – amoeba
    Commented Aug 3, 2017 at 18:47

1 Answer 1


See here. In short, "a model specifying random slopes for a between subjects variable would be unidentifiable." But you can still include within-subject factors as random slopes for subject RE.


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.