r语言 - 如何去除负二项式回归模型中的不显著因子



我已经在R中使用函数glm.nb((完成了负二项式回归建模。但是,一些因素和一些交互项对我的模型来说微不足道。如何删除不显著因子以获得更好的负二项式模型。下面显示输出:

> summary(nb) 
  Call:
  glm.nb(formula = LOS ~ patient + age + obesity + race + miscarriage + 
  primigravida + age*procedure, data = db , link = "log",    
  init.theta = 3.193556108)
   Deviance Residuals: 
   Min       1Q   Median       3Q      Max  
-2.5905  -0.7482  -0.3547   0.1226   7.7317  
   Coefficients:
                                         Estimate Std. Error z value Pr(>|z|)    
   (Intercept)                           0.992085   0.089697  11.060  < 2e-16 ***
   patient                               0.645335   0.034131  -1.435 0.331313 
   raceNon-Bumiputera                   -0.154894   0.052383  -2.957 0.003107 ** 
   ageMiddle                             0.102854   0.090392   1.138 0.255178    
   ageElder                              0.055655   0.099996   0.557 0.577815    
   obesityYes                           -0.250358   0.145008  -1.727 0.084256 .  
   miscarriageMiscarried                -0.060868   0.022096  -2.755 0.005875 ** 
   primigravidaYoung                     0.015143   0.084857   0.178 0.858366    
   primigravidamiddle                    0.231431   0.105432   2.195 0.028159 *  
   primigravidaElder                     0.348212   0.125971   2.764 0.005706 ** 
   procedureabortion                     0.316578   0.432455   2.467 0.341234
   procedurecsection                     0.014367   0.006113  -1.673 0.032131 **
   ageMiddle:procedureabortion           0.035266   0.041567  -1.451 0.034786 **
   ageElder:procedurecsection            0.658313   0.412243   2.111 0.324342
   ageMiddle:procedureabortion           0.124248   0.233214   1.353 0.143533 
   ageElder:procedurecsection            0.236575   0.034353  -1.235 0.013543 **  
   Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
   (Dispersion parameter for Negative Binomial(3.1936) family taken to be 1)
       Null deviance: 5759.6  on 5381  degrees of freedom
   Residual deviance: 4852.7  on 5354  degrees of freedom
   AIC: 26956
   Number of Fisher Scoring iterations: 1

          Theta:  3.1936 
      Std. Err.:  0.0899 
   2 x log-likelihood:  -26897.5170 

简短的回答可能是:不要。在非交互作用项中,ageobesity在任何因素水平上与其他项没有显着差异。但是,与age有显着的相互作用,如ageMiddle:procedureabortion。你不会错过那个,并且你很难解释和理解模型中没有原始术语本身的交互。因此,只有肥胖在任何表面水平上都不显着,但请注意,肥胖通常很容易确定,并且p在0.08左右时,它错过了意义,但在模型中可能仍然有用。

您应该检查的是,患者是否是患者 ID 或真正的数字。

您从远远超过5000个观测值中获取了大约28个系数。为什么你认为,如果你省略一两个预测因子,你的模型会更好?

最新更新