# Overdispersed and zero-inflated count data

I have a dataset with social media posts and like to predict the number of likes a post receives. So I fit a Generalised Linear Model (GLM). I am relatively new to GLMs but find them super cool. Inspecting the data, I think that they are overdispersed, but am not so sure about zero-inflation. This stack exchange post differentiates the two concepts. Here is my approach to check for overdispersion and zero-inflation.

The dependent variable number of likes ranges from 0 to 37,659. Out of the 8000 posts, 4359 posts (or roughly 54%) receive no likes. 3641 posts (46%) received at least one or more likes. The majority of posts that receive a like receive around 5 likes.

Comparing these numbers to a simulated quasi-poisson distribution based on this tutorial for R for 8000 data points, the range of number of likes should be 0 to 43 likes. Out of 8000 data points, 2415 (or 30%) should receive a like and 5585 (70%) should not receive a like.

Here a basic plot comparing both distributions.

I read around a bit what the options are for overdispersion and zero-inflation.

--> which one to use?
--> From what I understand the glm() function with family set to 'quasi-poission' in R automatically corrects for the degree of overdispersion?
--> What if a comparison of both models show a similar root mean-square error?

• Zero-inflated Poisson (ZIP) deal with excessive zeros, but I am not sure that this is the problem here? Also, I have no a priori rationale for the two processes that underlie ZIPs.

Any thoughts highly appreciated.

Fitting a GLM with a quasi-poisson distribution gives me results that I can "sell", but I want to make sure I pick a robust model that fits the data well.

• Have you considered an ordinal regression model?
– Noah
Commented Aug 22, 2023 at 15:57
• if you want to deal simultaneously with zero inflation and overdispersion, something to try would be a hurdle model (search.r-project.org/CRAN/refmans/pscl/html/hurdle.html). What's nice about these is they try to explain why you're seeing zeros (or nonzeros). Commented Aug 22, 2023 at 16:02
• You aren't going to find any (meaningful) distribution that has a 54% probability of zero and a 1/10,000 probability of > 30,000; that's a staggering amount of skew. I'd probably model it in two stages: P(like = 0) vs P(like > 0) and then P(like | like >= 1). A quick experiment with the zeta distribution on the latter indicates a parameter in the vicinity of 1.7 would give you a 1/4000 chance of an observation > 30,000, but that hardly qualifies as anything but "extremely rough cut, almost to the point of worthless" analysis. Commented Aug 22, 2023 at 17:18
• @jbowman Just make a mixture of a dirac delta distribution with a uniform distribution; nicely characterizes the "L" shape of the data ;-) Commented Aug 22, 2023 at 19:32
• hurdle models are a logistic regression and some other GLM combined. You first have a logistic regression which decides if a datapoint going to be zero or not, and then a GLM that decides what the nonzero distribution is. So you end up with two sets of regression coefficients. Commented Aug 24, 2023 at 4:37