If I understand correctly, a quasi Poisson regression assumes roughly that $$ \mbox{E}\left[y\left|x\right.\right] = \exp{\left(x^{\top}\beta\right)}, \quad \mbox{VAR}\left(y\left|x\right.\right) = \sigma^2 \exp{\left(x^{\top}\beta\right)}, $$ and estimates both $\beta$ and $\sigma^2$. (Poisson regression further assumes $\sigma=1$, rather than estimating it.)
I would like to test the variance assumption. That is, assuming $$ \mbox{E}\left[y\left|x\right.\right] = \exp{\left(x^{\top}\beta\right)}, \quad \mbox{VAR}\left(y\left|x\right.\right) = f\left(x\right) \exp{\left(x^{\top}\beta\right)}, $$ I would like to test the null hypothesis $$ H_0: f\left(x\right) = c,\,\,\mbox{for some}\,c. $$
The most widely used test, as given by Cameron & Trivedi (and implemented in AER::dispersiontest
), seems to assume
$$
\mbox{E}\left[y\left|x\right.\right] = \mu = \exp{\left(x^{\top}\beta\right)},
\quad
\mbox{VAR}\left(y\left|x\right.\right) = \mu + \alpha g\left(\mu\right),
$$
for some specified function $g\left(\cdot\right)$ (typically a linear or quadratic function), and tests the null hypothesis
$$
H_0: \alpha = 0.
$$
Is it possible to adapt this test for my purposes? Concretely can I, through some perverted usage of dispersiontest
, somehow assume
$$
\mbox{VAR}\left(y\left|x\right.\right) = \alpha_1 \mu + \alpha_2 \mu^2,
$$
and test $H_0: \alpha_2 = 0$ regardless of $\alpha_1$?
(I have tried to use dispersiontest
on a glm
object fit with quasipoisson
family, and get an error claiming that "only Poisson GLMs can be tested". So some extra fiddling will be required.)