I am re-posting this from stackoverflow after someone's kind suggestion. The suggestyThat person also suggested that the main of the issue may be low number of virus positive samples n=12. Which I suspected. But I am also wandering if linear seperationseparation could be an issue, as all the virus positives occur in the low food group. Can these problems be resolved using GLMMs or should I think of other statistical tests.?
Tried fitting the model:
Food_Treatment.glmer<-glmer(Virus_DNA~Food*Treatment+(1|Set),family=binomial,data=data,method = "ML")
Food_Treatment.glmer<-glmer(Virus_DNA~Food*Treatment+(1|Set),family=binomial,data=data,method = "ML")
to get the warning messages
"Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.001101 (tol = 0.001, component 3)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge: degenerate Hessian with 4 negative eigenvalues"
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.001101 (tol = 0.001, component 3)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge: degenerate Hessian with 4 negative eigenvalues
After running code with more iterations of the model, I still get the same warning messages: Food_Treatment.glmer<-glmer(Virus_DNA~Food*Treatment+(1|Set),data=data,family=binomial,control=glmerControl(optCtrl=list(maxfun=1e9)))
Food_Treatment.glmer<-glmer(Virus_DNA~Food*Treatment+(1|Set),data=data,family=binomial,control=glmerControl(optCtrl=list(maxfun=1e9)))
I then looked on-line and that people had similar problems and tried the otmizer "bobyqa":optmizer Food_Treatment.glmer<-glmer(Virus_DNA~Food*Treatment+(1|Set),data=data,family=binomial, control=glmerControl(optimizer="bobyqa",optCtrl=list(maxfun=1e9)))bobyqa
:
Food_Treatment.glmer <- glmer(Virus_DNA~Food*Treatment(1|Set),data=data,family=binomial, control=glmerControl(optimizer="bobyqa",optCtrl=list(maxfun=1e9)))
I then got the very similar warning messages:
"Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.00393532 (tol = 0.001, component 2)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge: degenerate Hessian with 2 negative eigenvalues"
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.00393532 (tol = 0.001, component 2)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge: degenerate Hessian with 2 negative eigenvalues
I then thought of simplifying the model and tried no interactions between explanatory variables, with the codes: Food.Plus.Treatment.glmer<-glmer(Virus_DNA~Food+Treatment+(1|Set),family=binomial,data=data)
and Food.Plus.Treatment.glmer<-glmer(Virus_DNA~Food+Treatment+(1|Set),family=binomial,data=data,control=glmerControl(optCtrl=list(maxfun=1e9)))
Only to get the warning messages code:
"Warning messages:
Food.Plus.Treatment.glmer<-glmer(Virus_DNA~Food+Treatment(1|Set),family=binomial,data=data)
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.00248016 (tol = 0.001, component 2)and
Food.Plus.Treatment.glmer<-glmer(Virus_DNA~Food+Treatment(1|Set),family=binomial,data=data,control=glmerControl(optCtrl=list(maxfun=1e9)))
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failedOnly to convergeget the warning messages : degenerate Hessian with 1 negative eigenvalues"
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.00248016 (tol = 0.001, component 2)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge: degenerate Hessian with 1 negative eigenvalues
So I tried this simplified model with the opimizers "bobyqa"optimizers bobyqa
and "Nelder_Mead"Nelder_Mead
, as well as the otimzers "nlminb"optimzers nlminb
and "L-BFGS-B"L-BFGS-B
from the package optimxoptimx
.
All but the "bobyqa" opimzersbobyqa
optimizers produce variations on the 2 warning messages. "bobyqa" otpimzerThe bobyqa
optimizer produces the 1 warning message:
"warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.00139574 (tol = 0.001, component 2)
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.00139574 (tol = 0.001, component 2)