[R-sig-ME] Main effects for zero inflation poisson regression

Francesco Romano fbromano77 at gmail.com
Mon Sep 25 07:09:48 CEST 2017


Hello Ben,


Thanks for the reply. I will give it a go on the glmmTMB group.
I have also taken the liberty of replying directly to you attaching
my csv file. Would you mind giving it a go with anova()?

I also emailed the maintainer Mollie Brooks.

Thanks,

Frank

Best,

Frank

On Mon, Sep 25, 2017 at 1:28 AM, Ben Bolker <bbolker at gmail.com> wrote:

> I think it would be worth posting this as an issue on the glmmTMB
> issues list here: https://github.com/glmmtmb/glmmTMB/issues .  (You
> might be able to attach a CSV file there: you can't send CSV
> attachments to this mailing list.)
>
> I'm not surprised that car::Anova doesn't work (I've still been
> working on that one: see
> https://github.com/glmmTMB/glmmTMB/blob/master/glmmTMB/
> inst/other_methods/car_methods.R
> ). On the other hand, I am surprised that the standard two-model
> anova() method doesn't work for you, e.g.
>
>  g1 <- glmmTMB(Reaction~Days+(Days|Subject),lme4::sleepstudy)
>  g0 <- update(g1,.~.-Days)
>  anova(g0,g1)
>
> On Sat, Sep 23, 2017 at 12:48 PM, Francesco Romano
> <francescobryanromano at gmail.com> wrote:
> > Hello All,
> >
> > I am trying to run a type III Anova test on a zero-inflation poisson
> model
> > with count data to obtain stats for main effects. In other words, I would
> > like the output to include the df, Chisq, and p value for the main effect
> > of my fixed effects. In the past, I have done this using the 'mixed'
> > function or 'car::Anova' functions from the car package, or in the more
> > traditional (and tedious) way by model comparison via anova(model1,
> model2,
> > etc...).
> >
> > Unfortunately, none of these methods work as R returns an error message:
> >
> >
> > #
> >> anova(p.tmb5, p.tmb5a)
> > Error in anova.glmmTMB(p.tmb5, p.tmb5a) :
> >   no single-model anova() method for glmmTMB
> >
> >> car::Anova(p.tmb5, type = "III")
> > Error in I.p[subs, , drop = FALSE] : subscript out of bounds
> > In addition: Warning message:
> > In is.na(coef(mod)) :
> >   is.na() applied to non-(list or vector) of type 'NULL'
> >
> > The mixed function also can't be used because it will not work with
> glmmTMB
> > which includes two formulas, one for the poisson regression, the other
> for
> > the zero-inflation (see below).
> >
> >  My final model has two fixed effects, Verb.form and Response.type, with
> > three levels each, and a random effect for participants.
> >
> >> p.tmb5<-glmmTMB(Count~Response.type*Verb.form+(1|Partname), data = p,
> zi
> > = ~Response.type)
> >
> > Any suggestions are greatly appreciated. I attach my data in csv format.
> > PS: Partnames and classes are fictitious.
> >
> > --
> > Frank Romano Ph.D.
> > _______________________________________________
> > R-sig-mixed-models at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list