Skip to content
Prev 6219 / 20628 Next

Problem with computing gr and false convergence

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/14/2011 06:45 PM, Iker Vaquero Alba wrote:
Oddly enough I am able to fit the model better when the continuous
variables are *not* centered and scaled.  I can't explain this
particularly well, but weird things sometimes happen when you have a
model that is on the edge of being overfitted (which this one still is
- -- 12 parameters plus two nested random effects for 94 data points in a
fairly unbalanced design). Some code is also included below to take a
quick look at the distribution of the data.  There are some patterns,
but the continuous variables don't seem to be doing too much ...

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),
               cbriventral=scale(briventral))
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  (still dicey)
with(X,table(site,pair,year))
library(lme4)
X <-
na.omit(subset(X,select=c(site,pair,year,sex,mod,nhatch,briventral,brithr,tlength,cond)))
g1 <-
glmer(nhatch~sex+mod+briventral+brithr+tlength+cond+year+(1|site/pair),
      data=X,family=poisson)
s.g1.5<-update(g1,~.-briventral)

library(ggplot2)
X2 <- melt(X,id.var=1:6)
ggplot(X2,
       aes(x=value,y=nhatch,colour=mod,shape=sex))+
         geom_point()+facet_grid(year~variable,scale="free_x")
ggplot(X,
     aes(x=mod,y=nhatch,colour=mod))+geom_boxplot()+facet_grid(year~sex)

dd <- drop1(g1)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk34vmEACgkQc5UpGjwzenNQ6wCfcdqWiIBponA2bbunKJva2L2V
drIAnA8HrCIYfGt/yWpZUdgMPTTP5CeX
=wLn4
-----END PGP SIGNATURE-----