0

My data is zero inflated so I'm running a zero-inflated model using glmmamdb:

Model3z <- glmmadmb(Count3 ~ Light3 + (1|Site3), zeroInflation = T, family= "poisson", data = dframe3)

However, when I try and do pairwise comparisons of the different light types in this model pwcs3 <- lsmeans(Model3z, "Light") I get the error message:

Error in ref_grid(object, ...) : Can't handle an object of class “glmmadmb” Use help("models", package = "emmeans") for information on supported models.

When I go on the emmeans package website it says that glmmadmb is no longer supported.

I've switched to pscl and the zeroinfl function but am unsure on how to restructure my code to fit the pscl format. Typing in P <- zeroinfl(Count3 ~ Light3 + (1|Site3), family = poisson, data = dframe3) gets the error message:

Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels In addition: Warning message: In Ops.factor(1, Site3) : ‘|’ not meaningful for factors

Is there another way of using glmmadmb with lsmeans? If not, does anyone know how a zero-inflated model code in pscl is supposed to look? Thanks.

Help
  • 101
  • Isn’t glmmTMB similar? That package is supported by emmeans. – Russ Lenth Oct 30 '19 at 19:16
  • You could also try the `qdrg()` function. See its help page. – Russ Lenth Oct 31 '19 at 03:39
  • I've switched to glmmTMB: Model3z <- glmmTMB(Count3 ~ Light3 + (1|Site3), ziformula = ~ 1, family= "poisson", data = dframe3) But now whenever I type pwcs3 <- lsmeans(Model3z, "Light") I get the error message 'No variable named Light in the reference grid' – Help Oct 31 '19 at 14:29
  • Well, it looks like the variable in the model is named Light3, not Light – Russ Lenth Oct 31 '19 at 16:33
  • Thank you! Everything's working now. Can't believe I missed something that simple. – Help Oct 31 '19 at 17:22

0 Answers0