I'm following up on this great answer regarding running Principal Component Analysis (PCA) to uncover the reason behind lack of convergence and/or singularity for Mixed-Effects models.
My model below doesn't convergence, however, I wonder why I don't get a convergence when model is not singular?
NOTE: When we drop the correlation between intercepts and slope the model below becomes singular! i.e., lmer(math ~ ses*sector + (ses || sch.id), data = dat)
library(lme4)
dat <- read.csv('https://raw.githubusercontent.com/rnorouzian/e/master/nc.csv')
m4 <- lmer(math ~ ses*sector + (ses | sch.id), data = dat)
summary(m4)
Random effects:
Groups Name Variance Std.Dev. Corr
sch.id (Intercept) 3.6302 1.9053
ses 0.7356 0.8577 0.46
Residual 10.1951 3.1930
Number of obs: 7185, groups: sch.id, 160
summary(rePCA(m4))
$sch.id
Importance of components:
[,1] [,2]
Standard deviation 0.6118 0.2321
Proportion of Variance 0.8742 0.1258
Cumulative Proportion 0.8742 1.0000
lmer(math ~ ses*sector + (ses || sch.id), data = dat)– rnorouzian Sep 29 '20 at 15:04sesandsector). This model is fundamental incorrect from a model-leveling perspective, right? – rnorouzian Oct 03 '20 at 05:08sesis average socio-economic status for each school, then random slopes means that each school has it's own slope forses? Does that make sense ? – Robert Long Oct 03 '20 at 08:45sesis NOT average socio-economic status for each school. I also contacted another HLM expert. Here is what he said: "we cannot put level 2 predictors in the random part. Because the level 2 predictor is constant within the cluster, while the HLM random part is the analysis about how the cluster affects predictors. If it's constant that means the cluster has no effect." – rnorouzian Oct 03 '20 at 15:20sesis. I was just using it as an example of something that would be constant at the school level. I am literally saying exactly what you have just quoted: When I said "Does that make sense ? " it is a rhetorical question - of course it does not make sense, because it's constant. – Robert Long Oct 03 '20 at 15:56blmeis not fully Bayesian iirc, whereasstandefinitely is, so that could be the reason. – Robert Long Oct 03 '20 at 16:59