Returns the dispersion of the fit, a scalar measure of how far the fitted
values spread around the data. For the count cases it is the Pearson
chi-square divided by the residual degrees of freedom, the GLM dispersion
(about 1 for a correctly specified Poisson model); for the rate cases it
is the mean squared log-residual. The value is also reported by
summary.MortalityLaw.
Examples
x <- 45:75
M1 <- MortalityLaw(x = x, Dx = ahmd$Dx[as.character(x), "1950"],
Ex = ahmd$Ex[as.character(x), "1950"],
law = "makeham", opt.method = "poissonL")
dispersion(M1)
#> [1] 3.869687