I'm trying to run a simple MLM, but I'm bumping into singular fit warnings:
y <- Reduce(c,replicate(10, scale(rnorm(700, 0, 1)))) x <- rep(c("A","B"), each=700, times=10) g <- rep(c("g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g9", "g10"), each=7000) df <- data.frame(y=y, x=x, g=g) m <- lmer(y ~ x + (1|g), data=df) boundary (singular) fit: see ?isSingular
I believe the reason for this warning is that there seems to be no variation of the random intercept as
I read several answers here in CV suggesting to reduce the complexity of the model, often by removing random slopes. However, this model is already as simple as it can get, and there are no random slopes. I also have over 200 groups in my actual data set so it cannot be that I have too few groups.
What are my options? Should I remove the random intercept entirely?