I ran zero-inflated Poisson regression with package pscl
and came across a same error with this post
However, since I know there is a separate process for excess zeros indicated by z
, does it still make sense to just run Poisson as a solution (Poisson results are just fine)? Is there an alternative way to fix this problem for ZIP? I also tried zero-inflated negative binomial regression but it got the same error. Thanks.
Call:
zeroinfl(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 | z, data = df)
Pearson residuals:
Min 1Q Median 3Q Max
-2.48465 -0.06156 -0.06126 -0.06091 5.57840
Count model coefficients (poisson with log link):
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.547e+00 NA NA NA
x1 -3.251e-02 NA NA NA
x2 6.290e-03 NA NA NA
x3 8.867e-01 NA NA NA
x4 1.432e-01 NA NA NA
x5 2.705e-01 NA NA NA
x6 -8.223e-10 NA NA NA
x7 -7.218e-02 NA NA NA
x8 3.322e-02 NA NA NA
x9 -2.072e-01 NA NA NA
Zero-inflation model coefficients (binomial with logit link):
Estimate Std. Error z value Pr(>|z|)
(Intercept) 5.531 NA NA NA
z 158.108 NA NA NA
Error in if (getOption("show.signif.stars") & any(rbind(x$coefficients$count, :
missing value where TRUE/FALSE needed
It's hard to answer this without a reproducible example, but I'll offer a couple of observations (too long for a comment):
pscl
's default behaviour is to use the same formula for both the zero-inflated and the count (conditional) part of the model. Unless you have an extremely large data set, you are very likely to have trouble fitting a 10-parameter model (intercept + 9 covariates) to both the count and zero-inflation aspects of the data. (A reasonable rule of thumb is that you should have 20 times as many observations as parameters, so that's a minimum of 400 observations -- and that rule is probably conservative for estimating zero-inflation.) x6
) is approximately zero, suggesting that you don't have enough variation in your data to estimate that parameter (or that there is some other issue with this covariate, eg you have an extreme outlier in this dimension). This could easily mess up the standard errors etc. for your whole model.General advice:
Uriarte and Yackulic, Ecological Applications, 19(3), 2009, pp. 592–596
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.