4
$\begingroup$

I'm fitting a generalized linear mixed model using glmer() and I'm getting a warning that I don't understand:

> glmerOut <- glmer(cbind(MissedMeds_N, TotalAdministrations) ~ RegisteredBeds + Ratings + month_id + (1|FacilityKey), family = "binomial", data = df, na.action = "na.omit")
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?

As this is just a warning, can I ignore it?

Here's a model summary:

> summary(glmerOut)
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
 Family: binomial  ( logit )
Formula: cbind(MissedMeds_N, TotalAdministrations) ~ RegisteredBeds +      Ratings + month_id + (1 | FacilityKey)
   Data: df

     AIC      BIC   logLik deviance df.resid 
 25671.9  25703.9 -12829.9  25659.9     1546 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-16.314  -0.971  -0.077   0.806  34.580 

Random effects:
 Groups      Name        Variance Std.Dev.
 FacilityKey (Intercept) 2.334    1.528   
Number of obs: 1552, groups:  FacilityKey, 197

Fixed effects:
                 Estimate Std. Error z value Pr(>|z|)    
(Intercept)    -5.0085199  0.3988178 -12.558  < 2e-16 ***
RegisteredBeds  0.0061837  0.0049708   1.244    0.213    
Ratings3        0.3042232  0.3028842   1.004    0.315    
Ratings4        0.0636890  0.3975268   0.160    0.873    
month_id       -0.0043179  0.0005467  -7.899 2.82e-15 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) RgstrB Rtngs3 Rtngs4
RegistrdBds -0.743                     
Ratings3    -0.732  0.191              
Ratings4    -0.432 -0.023  0.587       
month_id    -0.011  0.000  0.000  0.000
convergence code: 0
Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?

My goal is to evidence a decline in the ratio MissedMeds_N:TotalAdministrations for month_id and this model appears to support that with significance, but the warning message is throwing me. I don't think I can scale my variables? If I can rescale, which variables do I even need to rescale? Predictors or responses? Or both? Here's my data structure:

> str(df)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   3766 obs. of  6 variables:
 $ FacilityKey         : int  2 2 2 2 2 2 2 2 2 3 ...
 $ RegisteredBeds      : int  0 0 0 0 0 0 0 0 0 0 ...
 $ TotalAdministrations: int  5681 5138 4424 4600 4250 4434 4503 4001 4164 20691 ...
 $ MissedMeds_N        : int  335 332 323 330 325 330 330 310 299 NA ...
 $ month_id            : int  4 5 6 7 8 9 10 11 12 4 ...
 $ Ratings             : Factor w/ 4 levels "1","2","3","4": 3 3 3 3 3 3 3 3 3 NA ...

There is a very similar problem here and like the poster of that question, I'm a bit lost in ?convergence and optimizers and this wasn't fully addressed in the answer, and I don't fully understand the answer itself anyway, and I don't have a high enough reputation to comment.

$\endgroup$
1
  • $\begingroup$ I also met the same problem, adding nAGQ = 0 in glmer() does indeed remove the warning message. But what does nAGQ = 0 mean? I got larger p-value after adding nAGQ = 0. $\endgroup$
    – Shengyu
    Aug 24, 2022 at 5:39

2 Answers 2

5
$\begingroup$

It would be to try and rectify the problem to be certain that you have a well-converged model to use for your analysis.

A couple of hints:

  • Try fitting the model with the adaptive Gaussian quadrature instead the Laplace approximation. The former is known to be better for binomial data.
  • You could also give a try to the GLMMadaptive package that can fit the same model using the adaptive Gaussian quadrature.
$\endgroup$
3
  • 1
    $\begingroup$ Can glmer() from lme4 use the adaptive Gaussian quadrature? Or do I have to use GLMMadaptive for this? Using GLMMadaptive does seem to remove the convergence warning, but I don't know how to plot the residuals for GLMMadaptive and it looks pretty complicated to do so. $\endgroup$
    – B_Real
    Jun 11, 2019 at 14:56
  • $\begingroup$ Yes in this case you can also do it with glmer() - have a look at the nAGQ argument. $\endgroup$ Jun 11, 2019 at 20:37
  • 2
    $\begingroup$ Adding nAGQ = 0 in glmer() does indeed remove the warning message. Not going to pretend I understand it but I'm gonna go with it :-) $\endgroup$
    – B_Real
    Jun 12, 2019 at 8:51
-5
$\begingroup$

I am using clmm and I had the same warning. So, I tried removing the least significant predictor one at a time (backward elimination) until that warning disappeared. It seems that clmm is very sensitive to poor predictors.

$\endgroup$
2
  • $\begingroup$ If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review $\endgroup$
    – Antoine
    Jan 31, 2023 at 22:49
  • 5
    $\begingroup$ There doesn't seem to be any statistical principle at work in this answer. Instead, the proposal in this answer amounts to "fit a different model." But fitting a model with a different set of predictors may prevent you from learning anything useful. For example, one possible problem is that using this proposal could result in omitted variable bias. Other disadvantages to backward elimination can be found in stats.stackexchange.com/questions/89202/… $\endgroup$
    – Sycorax
    Jan 31, 2023 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.