[R-sig-ME] warnings when using binomial models and offset - NaNs
Joana Martelo
jo@n@m@rtelo @ending from gm@il@com
Mon Nov 26 13:33:05 CET 2018
Thanks for your email!
Warnings' problem is solved, however, when I use log(density) or log(density+1) I got NaNs because density has negative numbers. Density is 2,4,6 which standardized gives -1.793073717, -0.450015136, 0.893043446. So, log(-1.793073717+1)= NaN
Any suggestions?
Many thanks!
Joana
-----Mensagem original-----
De: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces using r-project.org] Em nome de Ben Bolker
Enviada: sexta-feira, 23 de Novembro de 2018 21:54
Para: r-sig-mixed-models using r-project.org
Assunto: Re: [R-sig-ME] warnings when using binomial models and offset
This is a pretty common error, which I've now added to the GLMM FAQ.
You should be using log(density), not density, as your offset term; if you use density, then you end up specifying that your capture counts are proportional to exp(density), which is often a ridiculously huge number.
cheers
Ben Bolker
On 2018-11-23 12:26 p.m., Joana Martelo wrote:
> Hello everyone
>
>
>
> I'm trying to model fish capture success using length, velocity and
> group composition as explanatory variables, density as an offset
> variable, and fish.id. as random effect. I'm getting the follow warnings:
>
>
>
> Model1<-glmer(capture~length+offset(density)+(1|fish.id),family=binomi
> al,dat
> a=cap)
>
>
>
> Warning messages:
>
> 1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
>
> Model failed to converge with max|grad| = 0.260123 (tol = 0.001,
> component
> 1)
>
> 2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
>
> Model is nearly unidentifiable: very large eigenvalue
>
> - Rescale variables?
>
>
>
>
>
> - I only get the warnings when I use length and group composition,
> not with velocity.
>
> - I don't get any warning if I don't use the offset.
>
>
>
> I've tried:
>
> Model1<-glmer(capture~length+offset(log(density))+(1|fish.id.c),family
> =binom
> ial(link="cloglog"),data=cap)
>
>
>
> But still get the warning.
>
>
>
> Any ideas of what might be the problem?
>
>
>
> Many thanks!
>
>
>
>
>
> Joana Martelo
>
>
>
>
>
>
>
>
>
> Melhores cumprimentos,
>
>
>
> Joana Martins
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
_______________________________________________
R-sig-mixed-models using r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
---
Este e-mail foi verificado em termos de vírus pelo AVG.
http://www.avg.com
More information about the R-sig-mixed-models
mailing list