Skip to content

Commit 96c7ad7

Browse files
d-morrisonclaude
andcommitted
docs(count-regression): extract quasipoisson subfile, use \ba/\ea macros
Addresses two review findings on #1138: - Extract the quasipoisson section's prose from chapters/count-regression.qmd into _subfiles/count-regression/_sec-quasipoisson.qmd, matching the pattern every other section in the chapter already follows. The parent keeps the heading and gains an include; the chapter drops from 180 to 134 lines. Verified content-neutral: a sorted comparison of the old chapter against the new chapter plus the new subfile is identical. - Convert the one remaining raw \begin{aligned}/\end{aligned} block in _sec_pois-reg_intro.qmd to the \ba/\ea macros (latex-macros/macros.qmd:140-141), matching every sibling derivation this PR already converted. Confirmed in the rendered HTML that \ba expands to \begin{aligned} as expected. The third finding (unverified @vittinghoff2e citations) is rebutted separately on the PR: all three claims check out against the source text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7041ea9 commit 96c7ad7

3 files changed

Lines changed: 51 additions & 50 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Another way to handle overdispersion ---
2+
rather than switching to the negative binomial distributional family ---
3+
is the quasipoisson approach.
4+
It assumes less *model structure* than the negative binomial does:
5+
rather than committing to a complete probability distribution
6+
and estimating by maximum likelihood,
7+
it assumes only the mean-variance relationship
8+
$\Var{Y \mid \vX=\vx, T=t} = \theta \mu(\vx, t)$,
9+
for a dispersion parameter $\theta$.
10+
It pairs that single assumption with a moment-based *inference method*,
11+
estimating $\theta$ from the Pearson residuals.
12+
13+
While point estimates for regression coefficients $\evb$
14+
remain identical to standard Poisson regression,
15+
their estimated standard errors are scaled by $\sqrt{\eth}$.
16+
This approach provides valid standard errors and $p$-values
17+
when overdispersion is multiplicative.
18+
That validity comes from the assumed mean-variance relationship itself.
19+
A sandwich (robust) variance estimator also uses the residuals,
20+
but it does not require the model's variance function to be correct;
21+
it accumulates the squared residuals across observations
22+
instead of scaling the variance formula the model supplied.
23+
Its validity therefore does not depend on that variance function
24+
being the right one,
25+
only on the mean model being approximately correct
26+
[@vittinghoff2e, §4.7.3.6 for linear regression;
27+
@vittinghoff2e, §8.3.1 for the generalized linear model case].
28+
The quasipoisson scaling has no such guarantee:
29+
its single $\eth$ is estimated under the assumption of proportionality,
30+
so if the variance is not proportional to the mean,
31+
the scaled standard errors are simply wrong.
32+
33+
Robust standard errors are not a free improvement, though.
34+
For linear regression, @vittinghoff2e [§4.7.3.6] reports simulations
35+
in which robust standard errors can be too small
36+
in samples as large as 250 observations,
37+
and recommends the more conservative HC3 estimator at those sizes.
38+
The specific remedy is a linear-model construction,
39+
but the caution about small samples is worth carrying over
40+
to the sample sizes many epidemiological studies actually have.
41+
42+
The quasipoisson approach is simpler to implement
43+
than the negative binomial model,
44+
but provides less information than a full negative binomial likelihood:
45+
it does not specify a full parametric distribution
46+
for prediction intervals or model likelihood comparisons.
47+
48+
See `?quasipoisson` in R for implementation details.

_subfiles/count-regression/_sec_pois-reg_intro.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ to the event rate and linear predictor as:
1515
:::
1616

1717
$$
18-
\begin{aligned}
18+
\ba
1919
\Expp[Y \mid \vX = \vx, T = t] &= \mu(\vx,t) \\
2020
\mu(\vx,t) &= \lambda(\vx)\cdot t \\
2121
\lambda(\vx) &= \exp{\eta(\vx)} \\
2222
\eta(\vx) &= \beta_0 + \beta_1 x_1 + \dots + \beta_p x_p
23-
\end{aligned}
23+
\ea
2424
$${#eq-mean-poisson}
2525
2626
::: notes

chapters/count-regression.qmd

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -113,54 +113,7 @@ for the count component.
113113

114114
## Quasipoisson regression
115115

116-
Another way to handle overdispersion ---
117-
rather than switching to the negative binomial distributional family ---
118-
is the quasipoisson approach.
119-
It assumes less *model structure* than the negative binomial does:
120-
rather than committing to a complete probability distribution
121-
and estimating by maximum likelihood,
122-
it assumes only the mean-variance relationship
123-
$\Var{Y \mid \vX=\vx, T=t} = \theta \mu(\vx, t)$,
124-
for a dispersion parameter $\theta$.
125-
It pairs that single assumption with a moment-based *inference method*,
126-
estimating $\theta$ from the Pearson residuals.
127-
128-
While point estimates for regression coefficients $\evb$
129-
remain identical to standard Poisson regression,
130-
their estimated standard errors are scaled by $\sqrt{\eth}$.
131-
This approach provides valid standard errors and $p$-values
132-
when overdispersion is multiplicative.
133-
That validity comes from the assumed mean-variance relationship itself.
134-
A sandwich (robust) variance estimator also uses the residuals,
135-
but it does not require the model's variance function to be correct;
136-
it accumulates the squared residuals across observations
137-
instead of scaling the variance formula the model supplied.
138-
Its validity therefore does not depend on that variance function
139-
being the right one,
140-
only on the mean model being approximately correct
141-
[@vittinghoff2e, §4.7.3.6 for linear regression;
142-
@vittinghoff2e, §8.3.1 for the generalized linear model case].
143-
The quasipoisson scaling has no such guarantee:
144-
its single $\eth$ is estimated under the assumption of proportionality,
145-
so if the variance is not proportional to the mean,
146-
the scaled standard errors are simply wrong.
147-
148-
Robust standard errors are not a free improvement, though.
149-
For linear regression, @vittinghoff2e [§4.7.3.6] reports simulations
150-
in which robust standard errors can be too small
151-
in samples as large as 250 observations,
152-
and recommends the more conservative HC3 estimator at those sizes.
153-
The specific remedy is a linear-model construction,
154-
but the caution about small samples is worth carrying over
155-
to the sample sizes many epidemiological studies actually have.
156-
157-
The quasipoisson approach is simpler to implement
158-
than the negative binomial model,
159-
but provides less information than a full negative binomial likelihood:
160-
it does not specify a full parametric distribution
161-
for prediction intervals or model likelihood comparisons.
162-
163-
See `?quasipoisson` in R for implementation details.
116+
{{< include _subfiles/count-regression/_sec-quasipoisson.qmd >}}
164117

165118
# More on count regression
166119

0 commit comments

Comments
 (0)