where y and n are respectively the numerator and the denominator of the response, p.fit
is the fitted probability and φ is the fitted overdispersion parameter. When n = 0, the
residual is set to 0. Response residuals are computed as y/n - p.fit.
For models fitted with negbin or quasipois, Pearson's residuals are computed as:
(y - y.fit) / (y.fit + φ * y.fit^2)^{0.5}
where y and y.fit are the observed and fitted counts, respectively. Response residuals are
computed as y - y.fit.
data(orob2)
fm <- betabin(cbind(y, n - y) ~ seed, ~ 1,
link = "logit", data = orob2)
#Pearson's chi-squared goodness-of-fit statistic
sum(residuals(fm, type = "pearson")^2)