I have data for classes that are nested within schools
There are two classes for most schools (n = 240), but I also have some schools with which I have more than two classes. i.e., 20 schools with data from 3 classes, and 4 schools with data from 4 classes.
When I try to run a model like this,
model <- lmer(dv ~ 1 + classmotivation + schoolrep +(1+classmotivation+schoolrep|school/class), data=data)
I get a warning
Warning message: Model failed to converge with 2 negative eigenvalues: -3.1e+01 -4.0e+02
And I think it's because I don't have enough degrees of freedom to estimate all the random effects,
If I remove either predictor from the random slope like this,
model <- lmer(dv ~ 1 + classmotivation + schoolrep +(1+classmotivation|school/class), data=data)
model <- lmer(dv ~ 1 + classmotivation + schoolrep +(1+schoolrep|school/class), data=data)
the models run. but I'm not sure on what basis I should make such decisions. Is it theoretically-driven or is there something I should know in regard to whether to remove a school-level predictor or class-level predictor from the model (DVs -> class level)
I mean the results don't really change much, but I wasn't sure if I can just remove the slopes like that.