0

I'm fitting a model and carrying out backwards elimination. I've got to a point where a likelihood ratio test shows there is a significant difference in the model output if I exclude any more of the predictors, so the final model is this:

model_all_no_vis_SEP <- glmer(PCR_positive ~ (1|HH) + hum_pos_same_vis + sea_month + hhin + an_pos_same_vis + prot + ahcprog + accessdrugs1 + chicken_yn, family = binomial, data = rv2)

hhin and sea_month are multicat predictor variables (6 and 3 categories), the others are binary. HH as a random effect, the others as fixed effects

I get the following errors after it's run:

Correlation matrix not shown by default, as p = 14 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it

optimizer (Nelder_Mead) convergence code: 0 (OK)
Model failed to converge with max|grad| = 0.12702 (tol = 0.002, component 1)

Using allFit I've got the following output:

    aa <- allFit(model_all_no_vis_SEP)

bobyqa : [OK]
Nelder_Mead : [OK]
nlminbwrap : [OK]
nmkbw : [OK]
optimx.L-BFGS-B : [OK]
nloptwrap.NLOPT_LN_NELDERMEAD : [OK]
nloptwrap.NLOPT_LN_BOBYQA : [OK]
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.127216 (tol = 0.002, component 1)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.0398789 (tol = 0.002, component 1)

I'm pretty new to this- should I be happy with this output, or should I try and improve the max gradient so these warnings don't appear- if so, how do I do this?!

Thanks for your help, first time I've posted here so let me know if any more information is useful!

wils
  • 1
  • (1) Some suggestions here: https://joshua-nugent.github.io/allFit/ (2) I would try to increase the number iterations (this might resolve the warnings) and also ensure the estimates are broadly similar regardless of which optimizer method you try. – bzki Apr 10 '22 at 19:20
  • brilliant thank you i'll have a look at this! – wils Apr 13 '22 at 07:45

0 Answers0