I am in the process of trying to run the following code and am continuously getting the same error:
> model5 <- glmer(violentyn~vpul + bmi_new + wmax + (1|fid),
data = cohort4, family = binomial)
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.254024 (tol = 0.002, component 1)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
Rescale variables?
A couple of details about the variables I am using: I am predicting violent behavior in sons (binary 0/1) from sons' resting heart rate (continuous), alongside BMI and physical energy capacity variables as covariates (also continuous). I am clustering on the family id variable. This is a very large population sized dataset with fathers and sons included, but currently this analysis is only utilizing son-variables.
Upon looking at ideas I also tried running the above code with this optimizer modification at the end: control=glmerControl(optimizer="bobyqa"))
but am still getting the same error.
Does anyone have any thoughts on 1) why this is happening? or 2) things I can try to resolve this error?
When running allFit I am getting:
> summary(Newmodel)
$which.OK
bobyqa Nelder_Mead nlminbwrap optimx.L-BFGS-B nloptwrap.NLOPT_LN_NELDERMEAD
TRUE TRUE TRUE TRUE TRUE
nloptwrap.NLOPT_LN_BOBYQA
TRUE
$msgs
$msgs$bobyqa
$msgs$bobyqa[[1]]
[1] "Model failed to converge with max|grad| = 0.0492524 (tol = 0.002, component 1)"
$msgs$bobyqa[[2]]
[1] "Model is nearly unidentifiable: very large eigenvalue\n - Rescale variables?"
$msgs$Nelder_Mead
$msgs$Nelder_Mead[[1]]
[1] "Model failed to converge with max|grad| = 0.0208731 (tol = 0.002, component 1)"
$msgs$Nelder_Mead[[2]]
[1] "Model is nearly unidentifiable: very large eigenvalue\n - Rescale variables?"
$msgs$nlminbwrap
[1] "boundary (singular) fit: see help('isSingular')"
$msgs$`optimx.L-BFGS-B`
[1] "unable to evaluate scaled gradient" "Model failed to converge: degenerate Hessian with 1 negative eigenvalues"
$msgs$nloptwrap.NLOPT_LN_NELDERMEAD
[1] "unable to evaluate scaled gradient" "Model failed to converge: degenerate Hessian with 1 negative eigenvalues"
$msgs$nloptwrap.NLOPT_LN_BOBYQA
[1] "Model failed to converge with max|grad| = 17.0248 (tol = 0.002, component 1)"
$fixef
(Intercept)
bobyqa -12.325043
Nelder_Mead -12.326691
nlminbwrap -3.119328
optimx.L-BFGS-B -12.328315
nloptwrap.NLOPT_LN_NELDERMEAD -12.325046
nloptwrap.NLOPT_LN_BOBYQA -11.525685
$llik
bobyqa Nelder_Mead nlminbwrap optimx.L-BFGS-B nloptwrap.NLOPT_LN_NELDERMEAD
-7945.366 -7945.358 -15968.103 -7945.366 -7945.365
nloptwrap.NLOPT_LN_BOBYQA
-7987.759
$sdcor
fid.(Intercept)
bobyqa 28.77715048132
Nelder_Mead 28.81300356231
nlminbwrap 0.00004213222
optimx.L-BFGS-B 28.83265512110
nloptwrap.NLOPT_LN_NELDERMEAD 28.79536607386
nloptwrap.NLOPT_LN_BOBYQA 22.37746729938
$theta
fid.(Intercept)
bobyqa 28.77715048132
Nelder_Mead 28.81300356231
nlminbwrap 0.00004213222
optimx.L-BFGS-B 28.83265512110
nloptwrap.NLOPT_LN_NELDERMEAD 28.79536607386
nloptwrap.NLOPT_LN_BOBYQA 22.37746729938
$times
user.self sys.self elapsed user.child sys.child
bobyqa 169.55 12.90 182.62 NA NA
Nelder_Mead 240.92 18.10 259.18 NA NA
nlminbwrap 9.69 0.37 10.06 NA NA
optimx.L-BFGS-B 226.92 10.24 237.44 NA NA
nloptwrap.NLOPT_LN_NELDERMEAD 136.09 5.62 141.89 NA NA
nloptwrap.NLOPT_LN_BOBYQA 80.90 3.26 84.19 NA NA
$feval
bobyqa Nelder_Mead nlminbwrap optimx.L-BFGS-B nloptwrap.NLOPT_LN_NELDERMEAD
142 191 NA 50 103
nloptwrap.NLOPT_LN_BOBYQA
96
attr(,"class")
[1] "summary.allFit"