bbolker / glmmadmb

generalized linear mixed models with AD Model Builder
Other
11 stars 2 forks source link

Bug running owls example #4

Open mebrooks opened 7 years ago

mebrooks commented 7 years ago

I just installed from the source here and I'm getting an error when I run the Owls example with a random effect and zero inflation. Models with either a random effect or (exclusive or) zero-inflation but not both seem to work fine.

These give errors

> om <- glmmadmb(SiblingNegotiation~FoodTreatment*SexParent+
+            (1|Nest),
+           zeroInflation=TRUE,family="nbinom",data=Owls)
Error in `[.data.frame`(cor_dat, start_pos + (1:x$npar), start_pos + 4 +  : 
  undefined columns selected
> om <- glmmadmb(SiblingNegotiation~
+            (1|Nest),
+           zeroInflation=TRUE,family="nbinom",data=Owls)
Error in `[.data.frame`(cor_dat, start_pos + (1:x$npar), start_pos + 4 +  : 
  undefined columns selected

These run

> om <- glmmadmb(SiblingNegotiation~FoodTreatment*SexParent,
+           zeroInflation=TRUE,family="nbinom",data=Owls)
Estimated covariance matrix may not be positive definite
 0.62849 0.724777 0.948083 1.09684 137.488 857.973
> om <- glmmadmb(SiblingNegotiation~FoodTreatment*SexParent+
+            (1|Nest),
+           family="nbinom",data=Owls)
sargdavid commented 7 years ago

I get same error using my own data when I add a random effect (subject ID):

glmmadmb(Count ~ Treatment + Week, 
                    random =  ~ (Treatment | ID),
                    family = "nbinom",
                    save.dir = "tmp/glmmadmb_out",
                    zeroInflation = TRUE,
                    data = tmp.i)

Error in `[.data.frame`(cor_dat, start_pos + (1:x$npar), start_pos + 4 +  : 
  undefined columns selected

It runs if I set zero inflation to FALSE or if I remove the random effect.

In case this is a problem with the number of combinations, my data is as following: Number of Subjects: 23 Number of Treatments: 3 Number of time points (weeks): 4