I'm running logistic mixed-effects models for a project using
glmer(), but ran into a few problems with model fit.
In this model, there are 2 fixed effects:
- Factor A, a continuous variable (but only with 3 values, -25, 0, and 25)
- Factor B, a categorical variable with 4 levels
The only random effect structure in the model is
I collected data from 2 different samples for this project. For one of the samples that used this model structure I ended up getting a singularity warning, and the random effect/standard deviation is 0. The model ran just fine for the sample, but the random effect was relatively small - when I removed the random effect and ran a regular logistic regression using this second sample, and compared the regular logistic regression vs mixed effects logistic model using
anova.Mermod(), the addition of the random effect didn't seem to contribute significantly to the
glmer model with the random effect. Removing the random effect structure for models that previously ran into singularity issues also seemed to fix the problem (and it didn't give me weird coefficient estimates like in previous cases).
So this all seems good, except that removing the random effect of subject would also violate assumptions of independence (even though subject doesn't seem to contribute a significant amount of variance), and is it okay to violate this assumption in this particular scenario? If not, what would be some alternative solutions to this problem (the only thing I can think of is to run a mixed-ANOVA, treating Factor A as 3 levels of a discrete factor, and then following up with linear contrasts to look at the effect of Factor A at each level of Factor B). Any advice would be much appreciated!
EDIT: I ended up running GEEs to get around this issue, since the goal was not to model subject as a random factor, but rather to account for the within-subject variance.