Your primary question seems to be this one:
Given that $\theta$ can be freely adjusted, does it make sense to test, e.g., $H_0: \phi = 1$?
Two methods one can use for the Poisson are the score test and Lagrange multiplier tests. I might be wrong, but I imagine these can be generalized to a degree to an negative binomial model. A score test is a post-hoc test which tests whether the hypothesis of no overdispersion can be rejected:
$$
z = \frac{(y - \mu)^2 - y}{\mu\sqrt{2}}
$$
where $\mu$ is the predicted response and $y$ is the raw response. You basically fit a regular NB model, take the predictions from that model, and then solve for $z$:
#### Load Data ####
library(COUNT)
data(rwm5yr)
rwm1984 <- subset(rwm5yr, year==1984)
#### Fit NB Model ####
nb <- glm.nb(
docvis ~ outwork + age,
data=rwm1984
)
#### Get Mu ####
mu <- predict(nb, type="response")
#### Estimate Z ####
z <- ((rwm1984$docvis - mu)^2 - rwm1984$docvis)/ (mu * sqrt(2))
summary(zscore <- lm(z ~ 1))
The t-test from the intercept ($t = 7.082$, $p < .001$) shows the "no dispersion" hypothesis can be rejected. However, this test typically runs with the assumption that the dataset is large. One can alternatively use the Lagrange multiplier test instead, which is defined as:
$$
\chi^2 = \frac{\left(\sum_{i=1}^{n} \mu^2_i-n \bar{y}_i\right)^2}{2 \sum_{i=1}^{n} \mu^2_i}
$$
Estimated as so:
#### Setup Formula for Chi ####
obs <- nrow(rwm1984)
mmu <- mean(mu)
nybar <- obs*mmu
musq <- mu*mu
mu2 <- mean(musq)*obs
#### Chi Square Estimation ####
chival <- (mu2 - nybar)^2/(2*mu2)
chival
#### P Value ####
pchisq(chival,1,lower.tail = FALSE)
Once again, the hypothesis is rejected, with a fairly large chi-square score. Keep in mind that if you just want to get the dispersion from the model, this function can do that quite easily, and was created specifically for glm.nb
fits in the msme
package but written explicitly here:
#### Create Dispersion Function ####
p_disp <- function(x) {
pr <- sum(residuals(x, type = "pearson")^2)
dispersion <- pr/x$df.residual
return(c(pearson.chi2 = pr, dispersion = dispersion))
}
#### Check ####
p_disp(nb)
Where you can see the dispersion is clearly above 1. More about these tests can be found in the below reference.
Reference
Hilbe, J. M. (2014). Modeling count data. Cambridge Univ. Press.
summary
on aglm.nb
object, and it basically means nothing. It is only informative for Poisson and Binomial families. Check this: stats.stackexchange.com/questions/70619/… $\endgroup$glm.nb
uses a glm "fitter" function for which $\phi$ makes sense, but it is not used here. $\endgroup$glm
but not forglm.nb
? $\endgroup$glm.nb
is not a GLM in the classical definition since it involves a shape parameter $\theta$ which is estimated. It would be confusing to call $\theta$ a dispersion parameter although it controls the index of dispersion via $\text{ID} = 1 + \mu / \theta$. I can not see what would be the likelihood for a kind of generalized negative model that would use an extra third parameter $\phi$. $\endgroup$