I am looking at homicide rates per US county in a given 3-yr period as a DV, against several demographic and political measures as IV. I have A LOT of zeros for the DV, and these are presumably real zeros. My research has indicated that if I were using count data instead of rates, this would be a great match for ZIP or ZINB, which are available in R in the package pscl. However, it does not handle continuous data, in this case, homicide rates. The package CPLM has a compound poisson (tweedie) function for zero-inflated data, zcpglm, which assumes a continuous DV. It seems to handle the data well and produces reasonable-looking results (the results are very similar to what I get from ZINB if I round the rates to get integers so I can process them as counts).

Presuming the validity of the above choices, I would like to generate some goodness of fit tests. I can get a log-likelihood from zcpglm, so I can compare models to each other that way. But I would like to calculate deviance, and see if a pseudo-R^2 measure is possible, using


(from Heinzl & Mittlbock, Pseudo R-squared measures for Poisson, 2003).
The problem is that zcpglm does not provide the deviance, and I don't know how to create a saturated model to calculate the LL. The null model seems easy enough.

I have found examples for saturated models for a gaussian, poisson, ZIP & ZINB. But the latter three are only for count data, and this model clearly is neither count, nor gaussian. The p (index parameter) = 1.99 (and phi=0.46), indicating this is a gamma-like compound distribution, and a histogram seems to confirm it. But again, I'm not sure how to create a saturated model for a gamma distribution, and since this is a 2-part model anyway, it's making me even more stuck.

  • 1
    $\begingroup$ The reason why zcpglm doesn't compute deviances is presumably because they are not defined for this model. The concept of "deviance" is part of generalized linear model theory. But zero-inflated models are not true glms and hence don't have deviances. $\endgroup$ Commented Nov 13, 2017 at 8:06
  • 1
    $\begingroup$ There was a nice study last year (Martin & Hall, J of Stat Comp & Sim, 86:18, 2016) that explored whether deviance & R2 for ZIP & ZINB models could be conceptualized similar to GLM models. Simulations and application to real world events indicate the affirmative with good results. (deviance being "twice the difference in maximized loglikelihoods evaluated at the saturated and current models.") But they only look at count models, so only generate deviance and R2 equations for those $\endgroup$ Commented Nov 13, 2017 at 14:08


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.