I am having trouble with correlation of random effects in GLMER models in package lme4 for R. I have a model where:
Random effects:
Groups Name Variance Std.Dev. Corr
subject (Intercept) 0.25828 0.5082
x 0.02573 0.1604 -0.76
Task (Intercept) 0.87174 0.9337
x 0.10113 0.3180 -0.51
Number of obs: 104901, groups: subject, 1860; Task, 600
The correlation between intercept and slope in subject is -0.76. However when i extract the random effects for subjects using ranef
, and try to correlate the manifest intercept and slope, i get correlations above -.90! Also, when trying to correlate the slope with subject ability calculated as mean of accuracy (not by intercept), the correlation is also above -.90.
Can somebody explain me why this happens and how lme4 calculates the correlation between random effects? What is the true correlation in the end? Also, are extracted random effects good estimation of the latent random effects?
Thanks!