零膨胀负二项式分布函数NaN警告

alk20

我正在尝试将数据拟合为零膨胀的负二项式模型,但是当在摘要中计算SE时,我的3个独立变量之一(暴露)似乎正在导致生成NaN(请参见zeroinfl调用的结尾)。功能。我还尝试过运行负二项式障碍模型,并且遇到了类似问题。

str(eggTreat)
'data.frame':   455 obs. of  4 variables:
 $ Exposure : Factor w/ 2 levels "C","E": 2 2 2 2 2 2 2 2 2 2 ...
 $ hi_lo    : Factor w/ 2 levels "hi","lo": 2 2 2 2 2 2 2 2 2 2 ...
 $ Egg_count: int  0 0 0 0 0 0 0 0 0 0 ...
 $ Food     : Factor w/ 2 levels "1.5A5YS","5ASMQ": 2 2 2 2 2 2 2 2 2 2 ...
mod.zeroinfl <- zeroinfl(Egg_count ~ Food+Exposure+hi_lo | Food+Exposure+hi_lo, data=eggTreat,
+                          dist="negbin")
> summary(mod.zeroinfl)

Call:
zeroinfl(formula = Egg_count ~ Food + Exposure + hi_lo | Food + Exposure + hi_lo, data = eggTreat, dist = "negbin")

Pearson residuals:
     Min       1Q   Median       3Q      Max 
-0.65632 -0.47163 -0.28588  0.02976  9.00804 

Count model coefficients (negbin with log link):
            Estimate Std. Error z value Pr(>|z|)    
(Intercept) -0.04435    0.14393  -0.308   0.7580    
Food        -1.12486    0.22267  -5.052 4.38e-07 ***
Exposure    -2.34990    0.38684  -6.075 1.24e-09 ***
hi_lo       -0.44893    0.19524  -2.299   0.0215 *  
Log(theta)  -0.24387    0.22639  -1.077   0.2814    

Zero-inflation model coefficients (binomial with logit link):
              Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.830e+01         NA      NA       NA
Food        -5.768e+00  5.628e+04       0        1
Exposure     4.612e-01         NA      NA       NA
hi_lo       -7.477e+00  9.963e+05       0        1
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Theta = 0.7836 
Number of iterations in BFGS optimization: 21 
Log-likelihood: -350.2 on 9 Df
Warning message:
In sqrt(diag(object$vcov)) : NaNs produced
function (object, ...) 
{
  object$residuals <- residuals(object, type = "pearson")
  kc <- length(object$coefficients$count)
  kz <- length(object$coefficients$zero)
  se <- sqrt(diag(object$vcov))
本·博克

这个问题通常是由完全分离引起的; 使用此搜索词或搜索Hauck-Donner效应,将向您显示问题是,预测变量的某种线性组合可以完美地将零和非零分开(因为零通胀中的预测变量都是分类的,这将转换为所有值均为零或非零的类别的组合。

我来看一下with(eggTreat, table(eggcount>0, Food, Exposure, hi_lo))(以使表最容易阅读的顺序排列参数)。

典型症状包括:

  • 参数值较大(例如|beta|>10);在这种情况下,您的截距为-18.3,1e-8在基线类别中给出了0的预测零概率(其他两个值也很大,尽管不如截距那么极端)
  • 极大的标准误差(Foodhi_lo),导致z值有效为零,p值有效为1
  • 或...NA您所看到

有多种解决方案可以解决此问题:

  • 不同形式的正则化或贝叶斯先验
  • 使用模型比较/似然比检验计算p值
Zero-inflation model coefficients (binomial with logit link):
              Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.830e+01         NA      NA       NA
Food        -5.768e+00  5.628e+04       0        1
Exposure     4.612e-01         NA      NA       NA
hi_lo       -7.477e+00  9.963e+05       0        1

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章