我正在使用 R 中的广义线性模型分析计数数据。我从泊松族分布开始,但后来意识到数据明显过度分散。然后,我选择应用负二项分布的 glm(我正在使用glm.nb()MASS 包中的函数)。有趣的是,我使用前向和后向逐步选择方法获得了相同的最佳选择模型,即:
m.step2 <- glm.nb(round(N.FLOWERS) ~ Hs_obs+RELATEDNESS+CLONALITY+PRODUCTION, data = flower[c(-12, -17), ])
然后为了测试固定效果,我使用 anova() 函数,它给出:
anova(m.step2, test = "Chi")
Analysis of Deviance Table
Model: Negative Binomial(1.143), link: log
Response: round(N.FLOWERS)
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev Pr(>F)
NULL 15 40.674
Hs_obs 1 9.5978 14 31.076 0.001948 **
RELATEDNESS 1 9.4956 13 21.581 0.002060 **
CLONALITY 1 3.0411 12 18.540 0.081181 .
PRODUCTION 1 3.7857 11 14.754 0.051693 .
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Warning messages:
1: In anova.negbin(m.step2, test = "F") : tests made without re-estimating 'theta'
但是,如果存在过度离散(即使是负二项式),这些 p 值应该被纠正,不是吗?在我的例子中,剩余偏差(从 获得summary(m.step2))为 14.754,剩余自由度为 11。因此,过度离散为 14.754/11 = 1.34。
如何更正 p 值以解释在此负二项式模型中检测到的少量过度离散?