Let be passenger count and use a Poisson regression with log mean, initially treating the response as a working daily count:
Center and scale the continuous predictors before fitting, and compare a small set of defensible reduced models rather than saturating twenty observations. Household counts should not be called household proportions without a household denominator; population-scaled counts are alternative intensity covariates. Bus miles can be an estimated elasticity term rather than an offset, since proportionality of passenger numbers to bus miles has not been established.
For actual counts, the log-likelihood score is , with . Fitting by iteratively reweighted least squares uses weights and working response . Compare nested means by a likelihood-ratio test only if the Poisson variance assumption is plausible; check the Poisson deviance, Pearson dispersion , residuals, leverage and sensitivity to influential providers. Consider Quasi-Poisson regression or negative binomial regression if variance exceeds the mean.
The recorded response is actually a daily average, so Poisson working models for averaged counts need special care. If a provider was observed for days and total passengers were , fit with offset . If only the average and no observation duration are available, a Poisson mean model can still be explored, but its likelihood and standard errors are not automatically justified by integer-looking averages.
A one-unit increase in an untransformed predictor has fitted multiplicative mean effect ; a bus-mile elasticity gives a doubling effect . No numerical coefficient estimates or selected twenty-provider model are identifiable from the printed excerpt. The full provider file and, ideally, the averaging periods are needed to execute these model comparisons.
The Quasi-Poisson regression retains the same conditional mean but permits
This is a mean–variance function specification through quasi-likelihood; it does not assign a full probability distribution to each count. For independent observations, the quasi-score equation is proportional to , so the mean statistical parameter estimates equal those from Poisson regression. The output estimates through the Pearson dispersion estimator, and inflates the standard errors by approximately .
The large residual deviance relative to 728 residual statistical degrees of freedom also signals substantial overdispersion. Daily weather, traffic and other omitted conditions may produce greater count variation than a homogeneous Poisson distribution allows. The Quasi-Poisson regression accounts for that extra marginal variance. It still requires a correct conditional mean and an appropriate independence assumption; a common dispersion parameter alone does not repair serial correlation.
Under the more plausible Quasi-Poisson regression, the year Wald statistic is , with reported p-value . An approximate 95% confidence interval is
Thus the estimated fall is about 9.35%, but the data do not establish a reduction at the 5% level after allowing for overdispersion. The interval allows both a sizeable reduction and a small increase. The before–after comparison also lacks a contemporaneous randomized control, so causal inference about the campaign would require addressing other changes between years. The small Poisson regression p-value is not sufficient evidence of a campaign effect when its variance assumption is unsuitable.
The residual deviance is on residual degrees of freedom. Under a suitable Poisson deviance goodness-of-fit test approximation it is compared with , whose supplied 95th percentile is . Since is much larger, the chosen Poisson model does not provide a satisfactory absolute fit, despite being preferred among the three candidates.
The ratio suggests substantial overdispersion or mean-model misspecification. It is a deviance ratio, not the exact Pearson dispersion estimator, which cannot be computed from the excerpt. Check residual patterns, nonlinear effects, unusual rivers and dependence. A Quasi-Poisson regression could adjust uncertainty under an estimated dispersion, and a negative binomial regression could model extra count variation; a more adequate mean model may also be needed. The nominal Poisson tests in part (a) should be interpreted in light of this failure, rather than treated as a validated final analysis.
The Pearson dispersion estimator is , well above the Poisson value one. A Quasi-Poisson regression retains the logarithmic mean model but uses
This is a quasi-likelihood specification; it does not by itself identify a count probability distribution. For a common , the quasi-score equation is the Poisson score divided by , so its roots and fitted means are unchanged. Thus
Coefficient standard errors are multiplied by . The altitude standard error becomes , giving the requested approximate normal confidence interval
It excludes zero, so retain altitude on this approximate 5% test. Its test statistic is about after allowing for overdispersion, rather than the Poisson value . Rescaling uncertainty cannot repair a systematically misspecified mean; the diagnostics in part (e) motivate reconsidering that mean as well.
Use negative binomial regression with a logarithmic mean link, for example
library(MASS)
species_nb <- glm.nb(nspecies ~ altitude, link = log)
In the mean-size parametrization,
The extra parameter allows overdispersion that grows quadratically with the mean, unlike the proportional variance of Quasi-Poisson regression.
The printed assertion needs qualification: a negative-binomial model with fixed size is a generalized linear model. For known , its probability mass function is
With natural parameter , it has exponential family form
with dispersion one. A logarithmic link is permitted even though it is not the canonical link function. This is the fixed-size negative binomial generalized linear model.
What prevents a single ordinary fixed-family GLM fit in glm.nb is joint estimation of the unknown size : it changes the cumulant, carrier, and variance function, rather than merely multiplying a fixed variance function by a scalar dispersion. The routine alternates a GLM fit at fixed with size-parameter likelihood updates. Thus the intended distinction is between that enlarged fitting problem and a single fixed-family GLM, not a claim that negative-binomial regression can never be a GLM. The package documentation explicitly supports both conventions: stat.ethz.ch/R-manual/R-patched/library/MASS/html/glm.nb.html and stat.ethz.ch/R-manual/R-patched/library/MASS/html/negative.binomial.html.
The residual smooth rises from negative values, arches above zero, then falls at high fitted values. This suggests a nonlinear altitude effect on the log mean. Since the fitted log mean in the linear model increases with altitude, the horizontal fitted-value axis is also an increasing rescaling of altitude. A generalized additive model with Quasi-Poisson regression is therefore a reasonable candidate:
The centering constraint identifies the intercept. Here bs="cr" uses a penalized cubic regression spline. The plotted count residuals are deviance residuals, with the Q-Q panel using leverage-standardized versions. The quantile-quantile plot also shows tail discrepancies, but normality of count residuals is not a distributional assumption of this model: its main requirements are an adequate mean, variance relation, and independence. Investigate the labelled islands and possible excess variation as well.
The estimated smooth in the second plot increases fairly rapidly at low altitude, flattens around altitude 20 to 25, and is nearly level at the upper end. The pointwise bands widen where there are fewer observations. A penalized spline can describe a rise followed by a plateau without forcing a global parabola. A quadratic log mean has slope , so negative curvature eventually forces a decline and its curvature is constant everywhere. A cubic regression spline allows different curvature over different ranges, with a penalty controlling unnecessary wiggles and natural linear tails outside its boundary knots. The displayed smooth supports this greater flexibility, but it is not by itself a formal rejection of every quadratic model. Select complexity and compare predictive performance using cross-validation, then reassess residuals and the Pearson dispersion estimator.
Under fit.2, observations in each period are independent Poisson random variables with a common mean, so each sample variance should fluctuate around its sample mean. The plot instead has variances roughly 130–300 for means roughly 80–120, well above the line variance equals mean. This is overdispersion.
Day-to-day traffic variation can produce a Poisson mixture: a random daily intensity increases the marginal variance and can correlate observations from the same day. A useful replacement is a negative binomial regression, with variance , or a Poisson generalized linear mixed model with a day random intercept. A day-factor effect can also be included if inference is restricted to the observed days. A Quasi-Poisson regression estimates a dispersion multiplier for uncertainty, but does not itself explain the shared-day dependence and has no ordinary likelihood-based AIC. The means can retain the period-factor or selected jump structure.
Under a correctly specified Poisson regression with adequate expected counts, the residual Poisson deviance is approximately chi-squared distribution with residual degrees of freedom. The observed gives
Thus the ordinary Poisson model gives a very poor fit under this goodness-of-fit approximation. This is consistent with overdispersion, although a wrong mean model or dependence can also cause lack of fit; quasi-Poisson variance inflation alone does not establish that the mean model is adequate.
For Quasi-Poisson regression, . The Pearson dispersion estimator is
It uses squared Pearson residuals, not the residual deviance divided by 102. The fitted coefficients are unchanged, and their estimated covariance matrix is multiplied by . With , standard errors increase by , so the main treatment coefficient has
The main Progabide coefficient is not significant at 5% after this dispersion adjustment. R uses a Student's t-distribution when dispersion is estimated, as described in its GLM summary documentation; the large-sample normal approximation also gives the same decision.
Because an interaction term is present, this tests the treatment contrast at baseline zero. An overall absence of treatment influence requires the joint null . The printed marginal standard errors do not give their covariance, so they are insufficient to calculate that joint Wald test, or the treatment contrast test at an arbitrary nonzero baseline.
The researcher computed the Pearson chi-squared statistic
and compared it with a distribution, using residual degrees of freedom. Under an adequate large-sample Poisson regression, should be roughly the residual degrees of freedom. The reported tail probability rounds numerically to zero and gives strong evidence of overdispersion.
Possible causes include unobserved heterogeneity or omitted covariates, dependence among respondents, excess zeros, or an incorrect mean function. The conclusion that the Poisson variance assumption fails is well supported, although this test alone does not identify the cause or establish that the Quasi-Poisson regression variance is correct.
The reported Pearson dispersion estimator is , so
up to rounding.
The second fit is a Quasi-Poisson regression. It retains the logarithmic link function and mean model
but assumes only for an unknown dispersion parameter , rather than a complete Poisson distribution.
If counts events over days, then the daily average has mean and variance . It is not itself a Poisson variable unless . Known observation periods allow count modelling with a log-exposure offset; otherwise Quasi-Poisson regression may be used as a working mean-variance model, with uncertainty qualified by the missing exposure information.