Skip to content
Prev 6210 / 20628 Next

Problem with computing gr and false convergence

On 06/14/2011 04:12 PM, Iker Vaquero Alba wrote:
Unfortunately, looking at your data makes it very clear that you will
have a lot of trouble fitting this model: maybe this isn't the complete
data set ... ?

 * there are only two years, which makes it nearly impossible to handle
year as a random effect

  * you have a total of 94 observations in the data set, and your model
involves 41 (!!) fixed effect parameter.  There is just no way you can
fit this many parameters (even neglecting the random effects).

  I had some success with this model by dropping the interactions and
fitting only the main effects.  The site-level variance is estimated as
zero, but there is some pair*site variance (and a significant difference
between years, at least as inferred from a Wald Z test)

X <- read.table("nfledge-nhatch insects 2009-2010.txt",header=TRUE)
X <- transform(X,site=factor(site),pair=factor(pair),year=factor(year))
X <- transform(X,ctlength=scale(tlength,center=TRUE))
f1 <- nhatch~(sex+mod+briventral+brithr+tlength+cond)^2-sex:mod
ncol(model.matrix(f1,data=X)) ## 41 parameters!
f2 <- nhatch~sex+mod+briventral+brithr+tlength+cond+year
ncol(model.matrix(f2,data=X)) ## 12 parameters
with(X,table(site,pair,year))
library(lme4)
g1 <-
glmer(nhatch~sex+mod+briventral+brithr+ctlength+cond+year+(1|site/pair),
      data=X,family=poisson,na.action=na.omit)