4

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?

amoeba
  • 93,463
  • 28
  • 275
  • 317
mltjoysteak
  • 43
  • 1
  • 4

2 Answers2

7

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).

Heteroskedastic Jim
  • 4,567
  • 1
  • 10
  • 32
4

This is discussed here:

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3881361/

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.

benws
  • 84
  • 6
  • 3
    Welcome to our site! Thanks for giving a full citation with link, we appreciate it. – Silverfish Mar 21 '17 at 22:13
  • 2
    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. – Heteroskedastic Jim May 18 '19 at 22:29
  • @HeteroskedasticJim Which lme4 example are you referring to? – benws May 23 '19 at 18:04
  • 1
    Sorry, here https://stats.stackexchange.com/a/408983/162986 – Heteroskedastic Jim May 23 '19 at 18:07
  • @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. – benws May 24 '19 at 21:43
  • I agree, but this is semantics and somewhat besides the point. As you can do the same thing with a continuous variable that does not vary within the grouping factor. In my answer, I moved between calling them random slopes and intercepts. The only reason to call them random intercepts is the coding. If I had used standard dummy coding and left the intercept in there, it would be a random slope. – Heteroskedastic Jim May 24 '19 at 21:55