报告R中零膨胀负二项模型的倒比值比

时间:2016-10-21 17:39:11

标签: r regression logistic-regression

我试图找到报告R中零膨胀负二项模型的倒数比值比的好方法(命令zeroinfl in pscl)。我将尝试使用加州大学洛杉矶分校(http://www.ats.ucla.edu/stat/r/dae/zinbreg.htm)中的示例来说明我的问题。

m1 <- zeroinfl(count ~ child + camper | persons,
data = zinb, dist = "negbin", EM = TRUE)
summary(m1)

## Call:

zeroinfl(formula = count ~ child + camper | persons, data = zinb, 
##     dist = "negbin", EM = TRUE)
## Pearson residuals:
##    Min     1Q Median     3Q    Max 
## -0.586 -0.462 -0.389 -0.197 18.013 
## 
## Count model coefficients (negbin with log link):
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    1.371      0.256    5.35  8.6e-08 ***
## child         -1.515      0.196   -7.75  9.4e-15 ***
## camper1        0.879      0.269    3.26   0.0011 ** 
## Log(theta)    -0.985      0.176   -5.60  2.1e-08 ***
## 
## Zero-inflation model coefficients (binomial with logit link):
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)    1.603      0.836    1.92    0.055 .
## persons       -1.666      0.679   -2.45    0.014 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

所以现在我想做的是报告结果,以便:

  • 指数计数模型estimes及其CI(在此示例中为变量child和camper)
  • 指数和反向零模型估计(= OR)及其CI(以便OR显示“1”而不是“0”的优势比)(在此示例中为变量人员)

我能得到的最接近的是以下非常原始的代码(我还不熟悉R):

对于模型的零部分:

1/(exp(coef(m1, "zero"))) # to get the inverted ORs
1/exp(confint(m1)) # to get the CIs of the inverted ORs

对于模型的计数部分:

exp(coef(m1, "count")) # to get the incidence rate ratios(?)
exp(confint(m1))

所以基本上我几乎没有在使用观星者等的表格中整齐地报道这些......关于如何更接近报告结果的合理方式的任何建议都将受到高度赞赏!

0 个答案:

没有答案