Model deaths in disjoint equal-duration periods as independent observations with Poisson distributions with comparable population exposure and ascertainment. The expected before and after counts are and . Their difference has
The expected signal relative to its standard deviation is therefore
Under the null of equal rates, condition on : the first-period count has a binomial distribution with parameters and . At a total near 720, the two-sided 5% rejection boundary for is approximately . Under the proposed alternative, conditional on that total, its mean is and its variance is . Thus at the normal approximation gives power approximately
The lower-tail rejection probability is negligible at this alternative; allowing the Poisson total to fluctuate and using discrete rejection cutoffs changes the approximation slightly: an exact two-sided conditional test has about power under these Poisson means. Two years on each side should have adequate power for a 20% reduction under this model, though a particular realization can still fail to detect it.
This conclusion needs stable recording of drug-related deaths, comparable exposure denominators and no substantial overdispersion or temporal dependence. A change in population size, certification practice or other drug use can affect the comparison. Detecting a decline does not establish that mephedrone caused it: attributing displacement requires a credible comparison of potential outcomes, using an otherwise expected trend or other controls for changes occurring at the same time.
The second Poisson exposure model allows each location its own baseline accident rate:
The last equality is the corner-point constraint. The common after-to-before incidence rate ratio remains . This model is appropriate because the sites can have different background risks; treating those differences as unexplained Poisson variation made the first model fit poorly, with deviance on 14 residual degrees of freedom.
Adding seven location effects to the first fitted model reduces the deviance by , which is large relative to . The supplied sequential analysis of deviance reports a slightly different location contribution because it enters locations before the period indicator. The full model is much better but its deviance on 7 degrees of freedom still gives an approximate goodness-of-fit -value . That suggests residual lack of fit or overdispersion, although sparse accident counts make the asymptotic deviance goodness-of-fit test approximate.
Model each person's infections over the fixed exposure period as an independent Poisson random variable with mean , conditional on the explanatory variables. The sum over people is then Poisson distributed with mean , because independent Poisson counts add. This is reasonable for repeatable events occurring at an approximately constant rate without substantial clustering; the count need not be at most , so a binomial model would not describe repeated infections.
The Poisson regression uses a log link and the known offset . The omitted factor levels are the reference categories under treatment contrasts: their effects are absorbed into the intercept. Including all levels together with an intercept would make the design matrix linearly dependent. For the proposed new group, the relevant predictor uses the intercept, the infrequent-swimmer coefficient and the age-20–24 coefficient; beach and female are reference levels. Hence
To add the age-by-sex interaction, one possible R command is
glm(count ~ freq + loc + age * sex, family = poisson, offset = log(n), data = swimmers)
where swimmers denotes the data frame. The product expands to both main effects and their interaction. There are two additional interaction coefficients because age has three levels and sex has two.
The nested-model comparison is a likelihood-ratio test. The reduction in Poisson deviance is , asymptotically under the null hypothesis that both interaction coefficients are zero. Its reported -value gives evidence for an age-by-sex interaction at the five-percent level, though not at the one-percent level.
Neither fitted Poisson model fits well in an absolute sense. Comparing residual deviances with and respectively gives small tail probabilities: the deviance-to-degree-of-freedom ratios are about and . Improvement relative to the simpler model does not establish goodness of fit. Omitted structure, dependence or overdispersion could account for the remaining lack of fit; if the Poisson variance assumption is false, the nominal interaction-test calibration also needs reconsideration. The age label in the introductory legend is inconsistent with the actual model levels; the prediction uses the unambiguous age-20–24 row.
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 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 first model's residual deviance is on residual degrees of freedom, a ratio of about . This is far above the scale expected from a well-fitting dispersion-one grouped binomial regression. It suggests an inadequate mean function, overdispersion, or both. The linear age and exposure restrictions may miss nonlinear associations; the generalized additive model allows those shapes to be estimated through penalized cubic regression splines rather than assumed.
The very small exposure Wald p-value in the first fit suggests an association, but does not establish that a linear logit effect is adequate. Nor does the nonsignificant linear age term exclude every possible nonlinear age effect. Allowing estimated scale also addresses the excessive residual variation, which can arise from clustered data because several births belong to the same woman. The second model's estimated scale confirms that permitting smooth means has not removed all extra variation. The reason to proceed is poor initial fit and possible nonlinear effects, with dispersion-aware inference, not merely the wish to obtain more significant tests. These observational fits alone do not establish causation by the disaster.
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.
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.
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.
For fixed known , take the natural parameter of an exponential family
The negative binomial distribution has log-likelihood
Thus this is a negative binomial exponential family, with dispersion parameter in the convention of part (a). The carrier contains the Gamma function and depends on the fixed size , which need not be an integer. Differentiating the cumulant function of an exponential family gives
Therefore
The size controls overdispersion relative to a Poisson distribution; it is different from the unit dispersion parameter used by this fixed-size generalized linear model. Another common convention applies to the scaled response : then and . Keeping track of the response scale prevents confusing these two representations. At the law is concentrated at zero and is obtained as a boundary limit, rather than by a finite natural parameter of an exponential family.
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.
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.
Write , , and . We keep the model's printed coefficient literally. Its latent log odds can be written
The independence of the is conditional on : they are not marginally independent when the random effects are correlated.
Holding the other predictors and the random-effect realization fixed, increasing predictor by one shifts the latent log odds by , so it multiplies the conditional odds of a late departure by . For a binary snow indicator, this compares the snow and no-snow days with other predictors held fixed. This is a conditional odds ratio, not generally the same as a marginal odds ratio after integrating the random effects.
Randomizing allows unmeasured daily conditions to change the success probability beyond the systematic linear predictor. In this logistic-normal regression with autoregressive random effects, let and . The law of total variance gives
so the mixture allows overdispersion beyond a binomial distribution with fixed probability. The correlated part also allows related outcomes on nearby days.
The stationary autoregressive process of order one has and . Hence
The term is unstructured daily variability, whereas is the temporally correlated component under the printed parameterization. Larger gives greater persistence: the lag- correlation of the latent log odds is .
The PDF itself prints both the coefficient and the requested combination . They are inconsistent as a marginal variance. If the intended coefficient were , the variance and off-diagonal covariance would instead be and . The prior's argument list also repeats ; its displayed density indicates the intended second variance parameter is .
There is a further substantive issue with that improper prior. After integrating the latent variables, the observed-data likelihood function is positive and continuous at for fixed finite , positive , and . On a compact positive-volume set of those parameters it therefore has a positive lower bound for small . The prior density is , so integrating over gives . Thus the stated joint posterior distribution is improper, an instance of improper posterior from a log-uniform random-effect scale prior. The requested fixed-parameter conditional laws below are nevertheless proper; their existence does not remedy the joint impropriety.
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.
Let be the number of graduates in college . In model 1, every edge from a person in college to a person in college has probability
so
In model 2 the corresponding probability is
Because , the within-college indicator in model 3 vanishes, so . Consequently models 2 and 3 both give
The distinct edge indicators used in and are independent under all three models, so every model also forces and to be independent. Thus all members of one college have the same cross-college friendship propensity, with no person-level heterogeneity or dependence between their friendship counts. Real friendship networks can have unusually sociable individuals and correlated choices of friends, producing overdispersion and dependence that these models cannot fit.
Overdispersion means that conditional variance exceeds the Poisson mean. Under a correctly specified Poisson model, the Pearson statistic is approximately chi-squared with residual degrees of freedom. Here
so a one-sided five-percent test rejects. The displayed model-based confidence interval is too narrow. A quasi-Poisson fit can multiply standard errors by ; negative binomial regression or a random-effects count model can model the extra variation directly.
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.