Overdispersion tests in #rstats
This article is originally published at https://christopherlortie.info
A brief note on overdispersion
Assumptions
Poisson distribution assume variance is equal to the mean.
Quasi-poisson model assumes variance is a linear function of mean.
Negative binomial model assumes variance is a quadratic function of the mean.
rstats implementation
#to test you need to fit a poisson GLM then apply function to this model
library(AER)
dispersiontest(object, trafo = NULL, alternative = c(“greater”, “two.sided”, “less”))
trafo = 1 is linear testing for quasipoisson or you can fit linear equation to trafo as well
#interpretation
c = 0 equidispersion
c > 0 is overdispersed
Resources
- Function description from vignette for AER package.
- Excellent StatsExchange description of interpretation.
Thanks for visiting r-craft.org
This article is originally published at https://christopherlortie.info
Please visit source website for post related comments.