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))
x
depends ongroup
. To estimate both a random intercept and slope, though, you would need a lot of observations. $\endgroup$