Domanda

I came across an error I haven't been able to find any information on, and I haven't been able to figure it out, yet.

Here is an example:

x1 <- rnorm(100,0,1); x2 <- rnorm(100,5,1); x3 <- rnorm(100,8,4)
x4 <- rnorm(100,3,3); x5 <- rnorm(100,1,2); x6 <- rnorm(100,98,4)
y <- x1 + 2*x2 + x3/4 + 4.5*x4 + 2*x5 + 4*x6 + rnorm(100,1,50)

library(glmmADMB)
gm<-glmmadmb(y~x1+x2+x3+x4+x5+x6, family="gaussian")

library(MuMIn)
test.admb.dredge <- dredge(gm, nmax=2)

Error in AICc(global.model, nmax = 2) : 
  no applicable method for 'logLik' applied to an object of class "c('double', 'numeric')"

I've tried to supply a non-default rank argument (e.g. "BIC" or "QAIC") but got the same error message.

Here is my sessionInfo in case it is useful:

R version 3.0.3 (2014-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] glmmADMB_0.7.7 R2admb_0.7.10  MASS_7.3-30    MuMIn_1.9.26  

loaded via a namespace (and not attached):
[1] grid_3.0.3      lattice_0.20-27 Matrix_1.1-2-2  nlme_3.1-115   
[5] tools_3.0.3    
È stato utile?

Soluzione

I think this is a "thinko" that doesn't actually have anything to do with glmmADMB; rather (1) you should be using m.max=2 rather than nmax=2 and (2) nmax=2 does not provide a very clear error message.

I get exactly the same error if I substitute

gm2 <- lm(y~x1+x2+x3+x4+x5+x6)
dredge(gm2,nmax=2)

And everything seems to work fine if I use dredge(gm,m.max=2)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top