Calculate the dispersion parameter for a quasi-poisson model
calc_dispersion.RdConverted from STATA from armstrong 2014 supplement with LLM guidance. Minimal error checking of these inputs at present.
Examples
dispersion <- calc_dispersion(y = boston_deaths_tbl$daily_deaths,
X = cb,
stratum_vector = boston_deaths_tbl$strata,
beta = coef(m_sub))
#> Error: object 'cb' not found
dispersion
#> Error: object 'dispersion' not found