[R-sig-ME] R-sig-mixed-models Digest, Vol 81, Issue 40

Ben Bolker bbolker at gmail.com
Tue Sep 24 16:33:13 CEST 2013


Johannes Radinger <johannesradinger at ...> writes:

> 
> > Today's Topics:
> >
> >    1. Re: pwrssUpdate Error with new version of lme4 (Steve Walker)
> >
> >
> >
> Hi,
> 
> > Thanks for the reproducible example.  Unfortunately, I can't reproduce
> > your "pwrssUdate did not converge..." error.  
> Instead I get another error:
> >

  I was able to reproduce this.  While the data initially seemed to
me to be a bit on the edge (only three species present, nearly complete
separation in one of them), I did check -- lme4.0, glmmML, and
glmmADMB are all able to handle this case without too much difficulty
(although they do give warnings of "glm.fit: fitted probabilities of
0 or 1 occurred").  We will definitely see if we can figure out what
the problem is and make lme4 more robust for this case.

  Are you willing to have your data available as a test case
(in which case they would be available on Github, although not
in a very prominent place)?

library(lme4)
## source("radinger_dat.R") ## get data
mydf <- transform(mydf,species=droplevels(species))
mod <- glmer(presabs~predictor+(1|species),family=binomial,data=mydf)
mod2 <- glmer(presabs~predictor+(1|species),family=binomial,data=mydf,
              nAGQ=0)
mod2 <- glmer(presabs~predictor+(1|species),family=binomial,data=mydf,
              nAGQ=0,
              control=glmerControl(optimizer="bobyqa"),
              verbose=100)

library(ggplot2)
ggplot(mydf,aes(x=predictor,y=presabs,colour=species))+geom_point()
with(mydf,table(species))
with(mydf,table(presabs,species,predictor>0))
minz <- with(mydf,min(predictor[predictor>0]))
library("mgcv")
ggplot(mydf,aes(x=log10(predictor+minz/2),y=presabs,colour=species))+
    geom_point()+geom_smooth(method="gam",family=binomial)+
    facet_wrap(~species)

ggplot(mydf,aes(x=predictor,y=presabs,colour=species))+
    geom_point()+geom_smooth(method="glm",family=binomial)+
    facet_wrap(~species,scale="free_x")

lmList(presabs~predictor|species,family=binomial,data=mydf)
## Coefficients:
##         (Intercept)  predictor
## Pungtius -0.39436885 959.554470
## Rutiilus -0.02894044   2.704616
## Salmario  0.94294617   2.866079

g1 <- glm(presabs~species+predictor:species-1,family=binomial,data=mydf)
summary(g1)

library(lme4.0)
mod3 <- glmer(presabs~predictor+(1|species),family=binomial,data=mydf)

library(glmmADMB)
mod4 <- glmmadmb(presabs~predictor+(1|species),family="binomial",data=mydf)
summary(mod4)

library(glmmML)
mod5 <- glmmML(presabs~predictor,cluster=species,family=binomial,data=mydf)



More information about the R-sig-mixed-models mailing list