For the Poisson regression, the log-likelihood is
Since , the score function and its derivative are
Consequently a finite maximum-likelihood estimator satisfies
These nonlinear equations are normally solved by iteratively reweighted least squares. If has full column rank, the Hessian is negative definite and any finite solution is the unique maximizer. Full rank does not by itself rule out a boundary solution at infinite coefficients for every conceivable data set. The Poisson generalized linear model has dispersion one, so there is no separate scale parameter in this likelihood.
A Poisson model assumes independent counts between rats conditional on time, a common mean at a given time, and conditional variance equal to that mean. Comparable observation units and consistent counting are needed; unexplained rat-to-rat heterogeneity is excluded by this simple specification. The quadratic Poisson regression is
The printed nested analysis of deviance tests against . Its likelihood-ratio statistic is , approximately under the null hypothesis and regular Poisson asymptotics. The reported gives borderline rejection of the log-linear time effect at 5%, conditional on the Poisson assumptions. This is curvature of the log mean, rather than an ordinary quadratic model for the count itself.
There are only three distinct time values, so the intercept, linear term, and quadratic term span every possible set of three log means. This is Poisson mean saturation at three distinct times: the quadratic fit is saturated for the time-group means, which are , , and . A grouped deviance comparison against unrestricted time-group means has zero statistical degrees of freedom: the quadratic functional form cannot be tested at these three times. The individual-observation deviance 24.515 still describes within-group departure from the Poisson distribution, but small means and zeros make the naive goodness-of-fit calibration doubtful. Poisson variation itself can be checked using the replicates, preferably by a parametric bootstrap; it is not rendered untestable by the saturated mean specification.
Overdispersion means conditional variance exceeding the variance assumed by the Poisson mean model. For example, rats may have different latent susceptibility, so if , the law of total variance gives . A quasi-Poisson model instead uses . The Pearson-residual dispersion estimate is , using .
For the conventional quasi-likelihood comparison with estimated dispersion, use
Its upper-tail probability is about 0.096, so the evidence for curvature no longer reaches 5%. The F-distribution is an approximate calibration, not an exact small-sample result for arbitrary overdispersed counts; quasi-likelihood does not supply a full Poisson likelihood. With known dispersion one would instead compare approximately with . The displayed dispersion code uses the undefined name acf.glm2; its fitted values must be those of aom.glm2 for the stated calculation.
The coefficient labelled yr2 identifies year as a factor. With in the first year and in the second, the Poisson regression assumes independent daily counts conditional on year,
The unknown mean statistical parameters are the first-year log daily rate and the second-year log rate ratio ; the dispersion parameter is fixed at one. Approximate 95% Wald confidence intervals are
Exponentiating yields the first-year fitted daily mean , with confidence interval , and
The second-year fitted daily mean is . Thus this Poisson regression estimates a 9.35% fall, with an approximate interval for the percentage fall from 3.66% to 14.70%. These confidence intervals rely on the Poisson distribution and independence assumptions.
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 Poisson trick introduces . With an exactly flat log-rate prior, the baseline prior measure is . For ,
Thus flat log-rate marginalization gives the multinomial likelihood:
Alternatively, independent Poisson counts conditional on their total are exactly multinomial distributions with probabilities . Locally uniform coefficient priors make the coefficient posterior proportional to this likelihood within their flat region.
The printed BUGS prior is a proper normal distribution on , with variance , since BUGS uses precision as its second argument. It is broad but not exactly flat. Substitution shows that, apart from a coefficient-independent constant, the integrated likelihood is the multinomial kernel times the Gaussian log-rate correction to the Poisson trick
It depends on the coefficients through . Dominated convergence gives as , so the finite-variance code yields an approximation to the multinomial posterior, not exact equality. Large log rates can make prior sensitivity relevant.
The cell-wise factors form a standard Poisson regression, convenient for BUGS. They avoid an explicitly constrained count vector and permit scalar log-concave updates for intercepts and coefficients; an exactly flat-log-rate implementation also gives gamma conditional baseline rates. This can be computationally efficient, although the actual log-normal baseline prior is not gamma-conjugate and introduces nuisance intercepts. Efficiency depends on the update scheme.
The three Poisson regression models have independent counts and a logarithmic link function: their mean predictors include both pc and urban in m1, only urban in m2, and only pc in m3. Nested comparisons through the full model are preferable to a direct comparison of the two nonnested one-predictor models.
To remove urban from m1, test against . The likelihood-ratio test statistic is the deviance difference
with approximate null distribution . It is below , so do not reject at 5%. The corresponding Wald p-value is consistent with this decision. To remove pc from m1, test against a nonzero coefficient, giving with approximate null distribution ; reject decisively. The Akaike information criterion also prefers m3, whose value is smaller than and .
Among these three models choose m3, retaining building cover and omitting the urban indicator. This is a comparison within the stated Poisson family; its absolute fit must still be checked, as the next part does.
The chosen Poisson regression has fitted mean
For zero building cover, its fitted expected number of floods over the 25-year observation window is . Increasing the covered proportion by multiplies the fitted expected count by . Thus a ten-percentage-point increase, , multiplies the expected count by about , an increase of . A one-percentage-point increase multiplies it by about . The full-unit multiplier compares proportions differing by one, not percentages differing by one.
These are associations in the conditional expectation with the recorded final-year building cover. The regression coefficient is not automatically a causal effect of changing development, especially since the count covers 25 years while cover was measured at the end.
Let be the number of maintenance jobs, average temperature and average precipitation. The fitted Poisson regression assumes independent conditional responses with
The logarithm is the Poisson canonical link, so fitted means are always positive. The estimated regression coefficients are
At fixed precipitation, one unit of temperature multiplies the fitted mean by , a decrease of about . The fitted precipitation multiplier is per unit, but its large p-value gives little evidence for that effect. These are conditional associations, not established causal effects.
The intercept-only model has residual degrees of freedom, and the full model has . Both imply months.
For an approximate deviance goodness-of-fit test of the full Poisson regression, compare residual deviance with . Its upper-tail p-value supplies no evidence of lack of fit. The ratio also gives no striking indication of overdispersion, though deviance per degree of freedom is only a rough dispersion check. Fitted count means around fifty make the usual chi-squared approximation plausible. Independence between months, the conditional variance-equals-mean assumption and the absence of residual structure still need diagnostics. Failure to reject is not proof that the model is correct.
The null deviance on degrees of freedom has , suggesting the constant-mean model is inadequate. In the sequential analysis of deviance for nested generalized linear models, adding temperature to that model reduces deviance by on one degree of freedom, giving . Adding precipitation after temperature reduces it by only , with . Therefore retain temperature; these data give no reason to retain precipitation after temperature. The temperature-only residual deviance is on degrees of freedom. This prediction-oriented reduced model should be refitted before reporting its coefficients: the printed temperature coefficient belongs to the full model. The Wald test results, and , broadly support the same conclusion, while the sequential deviance tests answer the stated nested-model questions.
The Poisson regression uses independent counts with mean and logarithmic link function. Writing for concentration, the fitted predictors for strains are respectively
The interaction formula includes concentration, strain indicators and their products. The intercept is the baseline log mean at zero toxin; exponentiating it gives about fleas. Strain coefficients compare log means at zero concentration. Interaction coefficients compare concentration slopes with the common strain. A unit concentration increase multiplies the three means by about , and respectively.
For design matrix , the fitted expected Fisher information is , , since a Poisson count has variance equal to its mean. Standard errors are square roots of diagonal entries of . Each reported Wald test divides its coefficient estimate by its standard error and compares with an approximate standard normal distribution under a zero-coefficient null, conditional on the other terms. Concentration has strong evidence of a negative baseline effect. At zero concentration strain 1 is not significant at 5% (), while strain 2 is (). The strain-1 slope differs strongly from the baseline (); the strain-2 slope has no detected difference (). A nonsignificant difference is not proof of equality. The very significant intercept is a test of mean one at zero toxin, with little scientific relevance.
Relabelling factor levels merges strains 0 and 2 into one group and leaves strain 1 separate. Model retains three intercepts but allows only two slopes: strain 1 versus the common slope of strains 0 and 2. Thus it has five parameters, compared with six in . Model merges both intercepts and slopes for strains 0 and 2, retaining only four parameters. The natural nesting is .
For these nested generalized linear models, the difference in Poisson deviance is an asymptotic likelihood-ratio test statistic with degrees of freedom equal to the parameter difference. Comparing with gives on one degree of freedom, far below : the additional strain-2 slope is unnecessary. Comparing with gives on one degree of freedom, far above : merging the strain-0 and strain-2 intercepts is rejected. Comparing with uses on two degrees of freedom and requires a two-degree-of-freedom threshold, about , rather than the supplied .
is the most appropriate of the three models: retain different strain baselines and the special strain-1 slope, but pool the unsupported strain-2 slope difference. Residual degrees of freedom are ; deviances of this magnitude give no obvious evidence of overdispersion from these summaries alone.
The initial Poisson regression contains altitude, temperature, and their interaction term, with a logarithmic link function. Its interaction Wald test has , suggesting removal of that term while initially preserving both main effects. The resulting additive model has a negligible temperature effect (), suggesting a second simplification to altitude alone. The nested analysis of deviance for nested generalized linear models gives the same provisional decisions: deviance increases are and , each for one removed coefficient, with approximate upper-tail probabilities and . The Akaike information criterion also decreases at each step.
For independent island counts the final proposed model is
with fitted relation
This is an exponential mean relation on the count scale, not a linear relation between count and altitude. One additional metre multiplies the fitted expected count by . The null model's insignificance of individual main effects in the interaction fit does not require discarding every predictor: correlated design columns can make those conditional tests imprecise. These reductions concern relative mean complexity under the working Poisson regression; the large residual deviance in all three models warns that their variance or mean assumptions still need investigation.
For independent Poisson distributions, ignoring the factorial term only when taking likelihood differences,
The saturated likelihood maximizes each mean separately at , including its limiting value at zero. Therefore the Poisson deviance is
where is defined to be zero and . The expression is twice a saturated-model likelihood ratio difference, not twice a likelihood ratio itself.
With sufficiently large fitted counts and regularity, is approximately under a correctly specified Poisson regression. Here on 28 residual degrees of freedom, with upper-tail probability . The Poisson model fits poorly on this diagnostic. Its deviance is nearly three times its degrees of freedom, consistent with overdispersion, although a wrong mean function, dependence, or influential islands could also cause the discrepancy. The smaller Akaike information criterion than its competitors does not make this an adequate absolute fit.
Because no family is specified, the command fits a Gaussian identity-link generalized additive model:
The are centered penalized regression splines with cubic regression bases; centering separates them from the intercept. The age curve in the original figure falls to a minimum near age 25, then rises markedly, particularly from about 40 onwards. Its effective degrees of freedom are , reflecting curvature. The white-cell curve has effective degrees of freedom one and is nearly flat with a slight positive slope; the pointwise uncertainty bands are consistent with no substantial effect. These plots display centered partial mean contributions, not numbers of prescriptions by themselves.
A simpler mean model keeps the age regression spline and replaces the white-cell smooth by a linear term. A separate issue is that the response is a nonnegative count: a Poisson regression with logarithmic link function respects that support and positivity of the mean. A reasonable candidate is
model1p <- gam(npres ~ s(age, bs="cr") + wbc, family=poisson(link="log"))
gam.check(model1p)
If diagnostics show overdispersion, one can fit
model1nb <- gam(npres ~ s(age, bs="cr") + wbc, family=nb(link="log"))
using a negative binomial regression. Alternatively, if a Gaussian approximation is adequate, the minimal simplification is gam(npres ~ s(age, bs="cr") + wbc). These are candidates to compare by diagnostics and validation, rather than guaranteed improvements from the partial plots alone. Retain the curved age effect; consider a linear or removable white-cell effect, and assess an appropriate count family. Refit before interpreting the old curves on a new link scale.
The Poisson deviance tests overall fit against the saturated Poisson regression, not whether the single slope is zero. Under fit.1, its large-count approximation is . The observed value is 261.72, far above the one-percent upper critical value (about 85.95); its upper-tail probability is about . Thus reject fit.1 at the one-percent level. The slope's reported -value 0.421 only compares this inadequate log-linear trend with an intercept-only model; it is not a goodness-of-fit test.