[R-sig-ME] zero-inflated-count-data?

Ben Bolker bbolker at gmail.com
Tue Feb 27 02:17:14 CET 2018


 For some model types (unfortunately not pscl::zeroinlf(), it looks
like) you can just
use the simulate() method ...

By the way, Amal (hope that's a reasonable way to address you) - folks
are really helpful here (as
you will have noticed), but the list is primarily for questions about
*mixed* (hierarchical/multilevel/whatever) models.
At present your questions are more generic questions about
zero-inflation and generalized linear modeling.
I do recommend the books by Alain and his co-authors as a good way to
get started on the fairly
complex stuff you're attempting here.

On Mon, Feb 26, 2018 at 12:26 PM, Highland Statistics Ltd
<highstat at highstat.com> wrote:
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 26 Feb 2018 14:57:00 +0100
> From: "C. AMAL D. GLELE" <altessedac2 at gmail.com>
> To: Jonathan Judge <bachlaw01 at outlook.com>
> Cc: Ben Bolker <bbolker at gmail.com>,  R SIG Mixed Models
>         <r-sig-mixed-models at r-project.org>
> Subject: Re: [R-sig-ME] zero-inflated-count-data?
> Message-ID:
>         <CANrzCv0SZxAXjoftdkN7v5M4g6wrd3GM7qx23dFB=fi7JHisCg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
>
> Hi, dear all.
> Many thanks to you all for your very helpful answers.
> Jonathan,
> I've started fitting a model using zeroinfl function from pscl package, but
> I'm having the following
>
> difficulty according to one of my regressors, let be H_var (categorical
> with 8 levels):
> as regressors, I have 7 categorical variables (with a total of 26 levels)
> and two numerical
>
> variables;
> 1) when I fit the model like follows,
> model1<-zeroinfl(countdata~var1+H_var+var3+var4+var5+var6+var7+var8num
>
> +var9num,dist="negbin",data=mydata)
> , I receive the error message below:
> "Error in solve.default(as.matrix(fit$hessian)) :
>   system is computationally singular: reciprocal condition number =
> 7.05621e-21
> In addition: Warning message:
> glm.fit: fitted probabilities numerically 0 or 1 occurred
> "
> 2)
> but, if I remove H_var from the count component and fits model2 loke
> follows,
> model2<-zeroinfl(countdata~var1+var3+var4+var5+var6+var7+var8num+
> var9num|H_var,dist="negbin",data=mydata)
>  the model fits well and I do not receive error message anymore.
> 3)
> If use H_var in both component of the model, like follows,
> model3<-zeroinfl(countdata~var1+var3+var4+var5+var6+var7+var8num+
> var9num+H_var|H_var,dist="negbin",data=mydata)
> I receive the following error message:
> "Error in solve.default(as.matrix(fit$hessian)) :
>   system is computationally singular: reciprocal condition number =
> 4.2618e-20
> "
> Question:
>  Does someone have any idea about probables causes of the problems posed
> at points 1) and 3) ?
>
>
>
>
>
>
> Without seeing the data......simplify your model? Collinearity? Start simple
> and build up the complexity of the model.
> Maybe start with a Poisson GLM and figure out whether you really need a
> ZIP/ZINB? Why are you actually do a ZINB?
>
>
>
>
>
>
> can you, please, provide me details (some ways to do it) and/or lead about
> simulating data from a fitted model?
>
>
>
>
>
> See step 10 in:
>
> A protocol for conducting and presenting results of regression-type analyses
> (2016).
> Zuur & Ieno.
>
> http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12577/abstract
>
> and see Figure 8 from that paper for an example. R code is somewhere online
> as well.
>
>
> Alain
>
>
>
>
>
>
>
>  In advance, thanks for your answers.
> Best,
>
> 2018-02-25 23:55 GMT+01:00 Jonathan Judge <bachlaw01 at outlook.com>:
> --
>
> Dr. Alain F. Zuur
> Highland Statistics Ltd.
> 9 St Clair Wynd
> AB41 6DZ Newburgh, UK
> Email: highstat at highstat.com
> URL:   www.highstat.com
>
> And:
> NIOZ Royal Netherlands Institute for Sea Research,
> Department of Coastal Systems, and Utrecht University,
> P.O. Box 59, 1790 AB Den Burg,
> Texel, The Netherlands
>
>
>
> Author of:
> 1. Beginner's Guide to Spatial, Temporal and Spatial-Temporal Ecological
> Data Analysis with R-INLA. (2017).
> 2. Beginner's Guide to Zero-Inflated Models with R (2016).
> 3. Beginner's Guide to Data Exploration and Visualisation with R (2015).
> 4. Beginner's Guide to GAMM with R (2014).
> 5. Beginner's Guide to GLM and GLMM with R (2013).
> 6. Beginner's Guide to GAM with R (2012).
> 7. Zero Inflated Models and GLMM with R (2012).
> 8. A Beginner's Guide to R (2009).
> 9. Mixed effects models and extensions in ecology with R (2009).
> 10. Analysing Ecological Data (2007).
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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