1
$\begingroup$

I want to fit a linear mixed-effect model for a multilevel data as the following:

Normally distributed response = $y$

Second level cluster = $\text{group}$

First level observation from which responses are drawn

Two-level factor predictor = $x$ that is given on the cluster level

I am interested in estimating the fixed effects (between-cluster) adjusting for within-cluster correlation. Would it be better to fit random-effects with just a random intercept:

lmer(y ~ x + (1 | group))

Or should I include a random slope even though my predictor is a two-level factor?

lmer(y ~ x + (1 + x | group))

$\endgroup$
1
  • $\begingroup$ A random slope is like assuming that the effect of x depends on group. To estimate both a random intercept and slope, though, you would need a lot of observations. $\endgroup$ Commented May 8, 2020 at 4:33

1 Answer 1

1
$\begingroup$

If x is a level 2 predictor, then it cannot be specified as a random slope at the same level it characterizes. Imagine that we have surveyed students within classrooms about their teachers' instruction (level 1) and also surveyed the teacher about their instruction (level 2). We want to predict student achievement. We can allow the association between student perception and student achievement to vary across classrooms but we cannot specify the association between a teacher's perception of their instruction and student achievement to vary across classrooms. Teacher perceptions are at the same level as the level 2 cluster variable - teacher.

If you had a third level of clustering in your data, then you could specify the slope of a level 2 predictor as varying across level 3 groups. For example, if you had sampled from multiple schools. We could then allow the association between a teacher's perception of their instruction and student achievement to vary across schools.

$\endgroup$

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.