从R中的logistf中提取Chisq值

时间:2017-02-03 10:11:52

标签: r chi-squared logistf

我正在R

上运行logistf模型
fit<-logistf(data=data, Amylose_trans ~ Tissue + Species); summary(fit)
logistf(formula = Amylose_trans ~ Tissue + Species, data = data)

由Penalized ML安装的模型 置信区间和p值通过概率似然概况似然概况似然概况似然概况似然概况似然概率似然

                       coef se(coef) lower 0.95 upper 0.95       Chisq            p
(Intercept)      -2.9444390 1.529438  -7.803600 -0.8816003  9.89263874 1.659412e-03
TissueFresh_comb -0.8108826 2.128231  -6.917669  4.7311183  0.11508982 7.344222e-01
Tissueguts        6.7620487 2.026376   3.573546 12.5665756 29.41458648 5.843615e-08
TissueNodules    -1.0664308 2.053264  -6.764977  4.2922631  0.23665005 6.266362e-01
TissueOld_comb   -1.0664308 2.053264  -6.764977  4.2922631  0.23665005 6.266362e-01
SpeciesO.badius   0.2386536 1.461843  -5.491559  5.5635990  0.01074908 9.174251e-01
SpeciesO.sp.      0.2386536 1.461843  -5.491559  5.5635990  0.01074908 9.174251e-01

Likelihood ratio test=140.6088 on 6 df, p=0, n=144
Wald test = 31.04725 on 6 df, p = 2.482811e-05

协方差矩阵:

              [,1]      [,2]       [,3]       [,4]       [,5]          [,6]          [,7]
[1,]  2.339181e+00 -2.339181 -2.3391813 -2.3391813 -2.3391813  1.421471e-15  1.178081e-15
[2,] -2.339181e+00  4.529369  2.8174918  2.9407710  2.9407710 -1.080011e+00 -1.080011e+00
[3,] -2.339181e+00  2.817492  4.1061987  2.7118392  2.7118392 -6.690186e-01 -6.690186e-01
[4,] -2.339181e+00  2.940771  2.7118392  4.2158934  2.8078876 -8.414506e-01 -8.414506e-01
[5,] -2.339181e+00  2.940771  2.7118392  2.8078876  4.2158934 -8.414506e-01 -8.414506e-01
[6,]  1.421471e-15 -1.080011 -0.6690186 -0.8414506 -0.8414506  2.136985e+00  8.842641e-01
[7,]  1.178081e-15 -1.080011 -0.6690186 -0.8414506 -0.8414506  8.842641e-01  2.136985e+00

我一直试图提取Chisq值,但我无法弄清楚如何做到这一点!我可以很容易地提取coef,terms,p.values,lower和upper ci等,但是我无法找到提取Chisq值的方法

有什么建议吗?

提前致谢

2 个答案:

答案 0 :(得分:0)

以下应该可以解决问题:

qchisq(1-fit$prob,df=1)

答案 1 :(得分:-1)

“ drop1(fit)”应该可以。