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.
- GLMs with the family set to 'quasi-poisson' deal with overdispersion
- Negative binomial regression also deal with overdispersion
--> 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.