[R] glmm.admb - bug and possible solution??

Robert Bagchi bagchi.r at gmail.com
Thu Feb 9 18:46:39 CET 2006


Dear Dr Skaug  and R users,

just discovered glmm.admb in R, and it seems a very useful tool. 
However, I ran into a problem when I compare two models:

m1<-glmm.admb(survival~light*species*damage, random=~1, group="table", 
data=bm, family="binomial", link="logit")

m1.1<-glmm.admb(survival~(light+species+damage)^2, random=~1, 
group="table", data=bm, family="binomial", link="logit")

anova(m1, m1.1)

I get the following output with the warning

Analysis of Variance Table

Model 1: survival ~ light * species * damage
Model 2: survival ~ (light + damage + species)^2
NoPar LogLik Df -2logQ P.value
1 9.000 -103.307
2 9.000 -103.781 0 -0.948
Warning message:
NaNs produced in: pchisq(q, df, lower.tail, log.p)

The warning is generated because the df=0. This appears to be because 
the number of parameters is being incorrectly calculated (they should be 
9 and 8 respectively). I had a look at the function call in R, and the 
problem appears to be because npar is obtained from the file nbmm.par on 
line 140 of the function

out$npar <- as.numeric(scan("nbmm.par", what = "", quiet = TRUE)[6])

which doesn't appear to change between calculations (the file seems to 
hvae been created the first time I ran glmm.admb, and not to have been 
modified since).

Replacing this line with the following
out$npar<-p+m
seemed to work ok. Is this a legitimate solution?

I noticed that this isn't necessary for when I run the example for 
anova.glmm.admb (although this uses a different family). This seems to 
overwrite the nbmm.par file. Couldn't work out where this happens 
though, and take it that this occurs during the call to the ADMB 
program.  Any thoughts?

Many thanks
Robert

Below is the version information for R

platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 2.0
year 2005
month 10
day 06
svn rev 35749
language R


ADMB version
Package: glmmADMB
Version: 0.2
License: GPL
Packaged: Thu Dec 1 07:02:40 2005; andersn
Built: R 2.2.0; ; 2005-12-01 07:13:48; unix

-- 
Robert Bagchi
Animal & Plant Science
Alfred Denny Building
University of Sheffield
Western Bank
Sheffield S10 2TN
UK

t: +44 (0)114 2220062
e: r.bagchi at sheffield.ac.uk
   bagchi.r at gmail.com

http://www.shef.ac.uk/aps/apsrtp/bagchi-r




More information about the R-help mailing list