I have just started using mixed effect models, and I apologize if my question seems intuitive to most.

If there are between subject regressors in the model, is it still acceptable to include random slopes?

Not sure if this question even makes sense so let me contextualize it: If the treatment in my study is repeated measure, but I also want to look at whether the subject's extraversion has an effect on the outcome variable, is it acceptable to include both extraversion and random intercepts/slopes in the same model?

If we are already using the random intercept to capture the subject to subject variation in the outcome, would it wash out the effect the covariate might have on the outcome?

  • $\begingroup$ Does this refer to a continuous self-rated extraversion score? Needs explaining. $\endgroup$
    – Carl
    Nov 15, 2016 at 0:29
  • $\begingroup$ Hi Carl, yes! this is just a hypothetical example, but yeah a continuous self rated score is what i had in mind $\endgroup$ Nov 15, 2016 at 1:28

3 Answers 3


This is discussed here:


Barr, D. J., Levy, R., Scheepers, C., & Tily, H. J. (2013). Random effects structure for confirmatory hypothesis testing: Keep it maximal. Journal of Memory and Language, 68(3), 10.1016/j.jml.2012.11.001. http://doi.org/10.1016/j.jml.2012.11.001

(See the section: "Random effects in LMEMs and ANOVA: The same principles apply")

A model specifying random slopes for a between subjects variable would be unidentifiable. The data do not contain the information needed to estimate random slope variance, because each subject belongs to one and only one condition of the manipulation. Without observing subjects across conditions, variability by subject in the effect of the manipulation cannot be distinguished from residual error.

  • 3
    $\begingroup$ Welcome to our site! Thanks for giving a full citation with link, we appreciate it. $\endgroup$
    – Silverfish
    Mar 21, 2017 at 22:13
  • 3
    $\begingroup$ This answer is not or no longer correct. It relies on older formulations of these models, such that model formulation constrained thinking about the model. See alternative example here using lme4. $\endgroup$ May 18, 2019 at 22:29
  • $\begingroup$ @HeteroskedasticJim Which lme4 example are you referring to? $\endgroup$
    – benws
    May 23, 2019 at 18:04
  • 1
    $\begingroup$ Sorry, here stats.stackexchange.com/a/408983/162986 $\endgroup$ May 23, 2019 at 18:07
  • $\begingroup$ @HeteroskedasticJim Thanks. I agree with the comment on that post by DimitrisRizopoulos --- I would not describe the model you presented as having random slopes, because the random terms don't allow the association between a predictor and outcome to vary. Instead I would describe those as random intercepts, for which you're estimating the variance separately for men and women. $\endgroup$
    – benws
    May 24, 2019 at 21:43

This question is not elementary given the accepted answer (it is incorrect) and the number of votes it has. You can permit a random slope on extraversion - or any between subject regressor, and there may be information in the data to estimate it.

Douglas Bates has a relevant quote on the reason for such misconceptions in his book on mixed models (http://lme4.r-forge.r-project.org/book/, chapter 2):

The blurring of mixed-effects models with the concept of multiple, hierarchical levels of variation results in an unwarranted emphasis on “levels” when defining a model and leads to considerable confusion. It is perfectly legitimate to define models having random effects associated with non-nested factors. The reasons for the emphasis on defining random effects with respect to nested factors only are that such cases do occur frequently in practice and that some of the computational methods for estimating the parameters in the models can only be easily applied to nested factors. This is not the case for the methods used in the lme4 package. Indeed there is nothing special done for models with random effects for nested factors. When random effects are associated with multiple factors exactly the same computational methods are used whether the factors form a nested sequence or are partially crossed or are completely crossed.

One of the limitations of the older formulation related to an unwarranted emphasis on levels that became known as truths for mixed effects models is, "you can't have a random slope on a between subjects (level 2) regressor". For example, the software HLM forces you to define the level of variables and does not allow you to do this.

With modern computational approaches, simply think of variables and whether you expect the effect of a variable to vary across the grouping factor, regardless of whether the variable itself varies across the grouping factor. The only reason to worry about levels would be interpretation issues (that social scientists sometimes care about), and predictor specification issues (that they care less about).


I think you can do so, but only if you test the relationship between the variables you add. The relationship between the independent variable and the covariate should not be significant! you can include this in your model! example mod_4 <- lmer(dependentvar ~ independentvar + covariate : independentvar + (1| random effect), data = df)

I hope this makes sense


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.