[R-sig-ME] Specifying a (random effect for an) interaction among two level 1 variables?

Joshua Rosenberg jmichaelrosenberg at gmail.com
Wed Feb 21 01:21:36 CET 2018

Hi R-sig-mixed-models,

I have a question about specifying a random effect for the interaction
among two level 1 variables when there are random slopes for each of the

In short, *does specifying a random slope for both of the two variables
used in the interaction imply that the effect of the interaction is also
random across the level 2 units?*

Here's what the model (in lme4) looks like:

lmer(outcome ~ var1 + var2 + var1:var2 + (var1 | grouping_factor) + (var2 |
grouping_factor), data = d)

In the context of this model, I'm curious about whether the var1:var2
interaction term varies across the level 2 units. Intuitively, it makes
sense to me that it would, since the effects of its two components are
allowed to vary across the levels of the grouping factor, but I'm having
trouble thinking through it.

To give a bit more insight into my thinking, I tried something like the
following, but it didn't work (the model didn't converge):

lmer(outcome ~ var1 + var2 + var1:var2 + (var1 | grouping_factor) + (var2 |
grouping_factor) + (var1:var2 | grouping_factor), data = d)

Thank you in advance.


Joshua Rosenberg, Ph.D. Candidate
Educational Psychology
 Educational Technology
Michigan State University

	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list