I currently am fitting a mixed model on a data set of n=20,000 and my model takes the following form
mask_model=glmer(y~x_1+x_2+(1+x_3||x_4)+(1|x_5),data=fake_data,family="binomial)
So we have a random intercept and slope for each x_4
group, and a random intercept for each x_5
group.
x_3
takes one of 18 values, x_4
takes one of three values, and x_5
takes one of 20,000 values.
I am able to fit mask_model
in a few minutes. However when I attempt to extract the random effects from this model via ranef(mask_model)
my computer just hangs. This strikes me as strange as I would think when I make the original glmer()
it would calculate these random effects. If I exclude the random intercept involving x_5
, or if I make x_5
only take one of 5000 values then ranef()
seems to work.
Would greatly appreciate any insight into why this might be happening and a potential workaround.
I receive the following output from summary(mask_model)
When I run getME(mask_model, "b") I get a 8625x1 vector, (I have 8619 id's and 3 provinces). It appears to be that this is the conditional mode of the random effects, but ideally I could somehow extract what the id random effect is for each participant, and the random slope/intercept for each province (if that is possible; unfortunately ranef(mask_model) just hangs in R).