是否有测试来确定 GLM 过度分散是否显着?

机器算法验证 统计学意义 过度分散
2022-01-16 07:43:46

我正在 R 中创建 Poisson GLM。为了检查过度分散,我正在查看由summary(model.name).

是否存在将该比率视为“显着”的临界值或测试?我知道如果它 > 1 则数据过度分散,但如果我的比率相对接近 1 [例如,一个比率为 1.7(残余偏差 = 25.48,df = 15),另一个比率为 1.3(rd = 324,df = 253)],我还应该切换到准泊松/负二项式吗?我在这里发现了这个显着性检验:1-pchisq(residual deviance,df),但我只见过一次,这让我很紧张。我还读到(我找不到来源)比率 < 1.5 通常是安全的。意见?

4个回答

在 R 包 AER 中,您将找到函数dispersiontest,它实现了Cameron & Trivedi (1990)的过度分散测试。

它遵循一个简单的想法:在泊松模型中,均值是,方差也是他们是平等的。该检验只是将此假设作为零假设与的替代项进行对比,其中常数表示欠分散,表示过度分散。函数是一些单调函数(通常是线性或二次函数;前者是默认值)。得到的测试等效于测试 vs.并且使用的测试统计量是统计量,在 null 下是渐近标准正态的。E(Y)=μVar(Y)=μVar(Y)=μ+cf(μ)c<0c>0f(.)H0:c=0H1:c0t

例子:

R> library(AER)
R> data(RecreationDemand)
R> rd <- glm(trips ~ ., data = RecreationDemand, family = poisson)
R> dispersiontest(rd,trafo=1)

Overdispersion test

data:  rd
z = 2.4116, p-value = 0.007941
alternative hypothesis: true dispersion is greater than 0
sample estimates:
dispersion 
    5.5658 

在这里,我们清楚地看到存在过度分散的证据(c 估计为 5.57),这强烈反对等分散的假设(即 c=0)。

请注意,如果您不使用trafo=1,它实际上会测试 vs. with这当然与其他测试具有相同的结果除了测试统计量被移动了一个。然而,这样做的原因是后者对应于准泊松模型中的公共参数化。 H0:c=1H1:c1c=c+1

另一种方法是odTest来自pscl库,它将负二项式回归的对数似然比与泊松回归的限制进行比较。得到以下结果:μ=Var

>library(pscl)

>odTest(NegBinModel) 

Likelihood ratio test of H0: Poisson, as restricted NB model:
n.b., the distribution of the test-statistic under H0 is non-standard
e.g., see help(odTest) for details/references

Critical value of test statistic at the alpha= 0.05 level: 2.7055 
Chi-Square Test Statistic =  52863.4998 p-value = < 2.2e-16

在这里,泊松限制的空值被拒绝,以支持我的负二项式回归NegBinModel为什么?因为检验统计52863.4998超过2.7055.p-value of < 2.2e-16

的优点AER dispersiontest是类“htest”的返回对象比无类的“odTest”更容易格式化(例如转换为LaTeX)。

另一种选择是使用包中的P__disp功能msme用或拟合模型后,P__disp函数可用于计算 Pearson和 Pearson 离散度统计量。χ2glmglm.nb

另一种选择是使用似然比检验来表明具有过度分散的准泊松 GLM 明显优于没有过度分散的常规泊松 GLM:

fit = glm(count ~ treatment,family="poisson",data=data) 
fit.overdisp = glm(count ~ treatment,family="quasipoisson",data=data) 
summary(fit.overdisp)$dispersion # dispersion coefficient
pchisq(summary(fit.overdisp)$dispersion * fit$df.residual, fit$df.residual, lower = F) # significance for overdispersion