A function to calculate Pearson Chi2 and its dispersion statistic following glm and glm.nb.
Useful links