[原创]R语言逻辑回归NRI、IDI 指标比较案例 附代码数据 联系客服

发布时间 : 星期二 文章[原创]R语言逻辑回归NRI、IDI 指标比较案例 附代码数据更新完毕开始阅读077f8d1082c4bb4cf7ec4afe04a1b0717fd5b3a4

【原创】附代码数据

有问题到淘宝找“大数据部落”就可以了 逻辑回归NRI、IDI 指标比较案例 head(data) ## 是否复发 术前PSA CAPRA-S评分 725.226 1014.16 1328.55 ## 1 0 3 2 2 2 1 ## 2 0 3 2 2 3 1 ## 3 0 1 1 1 3 1 ## 4 0 2 2 2 1 2 ## 5 0 2 2 1 1 2 ## 6 0 2 2 1 2 1 三个logistic回归模型与只有PSA+CAPRA score基础模型 加入了725,1014和1328 ,分别建立了三个logistic 回归模型,分别比较NRI、IDI 指标。 原始模型 logitMod<-glm(是否复发 ~ 术前PSA+`CAPRA-S评分` , data=data, family=binomial(link=\)) summary(logitMod) Deviance Residuals: Min 1Q Median 3Q Max -1.8076 -1.0169 -0.4592 0.7041 2.1457 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -4.0032 0.9489 -4.219 2.45e-05 *** 术前PSA 0.1481 0.3991 0.371 0.710537 `CAPRA-S评分` 1.6585 0.4641 3.574 0.000352 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1)

【原创】附代码数据

有问题到淘宝找“大数据部落”就可以了 Null deviance: 131.85 on 98 degrees of freedom Residual deviance: 106.78 on 96 degrees of freedom AIC: 112.78 Number of Fisher Scoring iterations: 4 725.226 logitMod1<-glm(是否复发 ~ 术前PSA+`CAPRA-S评分`+`725.226` , data=data, family=binomial(link=\))summary(logitMod1) Deviance Residuals: Min 1Q Median 3Q Max -1.7219 -0.8988 -0.4221 0.7178 2.8554 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -7.1845 1.4842 -4.841 1.29e-06 *** 术前PSA -0.2366 0.4501 -0.526 0.599055 `CAPRA-S评分` 1.9122 0.5452 3.507 0.000453 *** `725.226` 1.6861 0.4451 3.788 0.000152 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 131.851 on 98 degrees of freedom Residual deviance: 88.256 on 95 degrees of freedom AIC: 96.256 Number of Fisher Scoring iterations: 5

1014.16

【原创】附代码数据

有问题到淘宝找“大数据部落”就可以了 # 1014.16 logitMod2<-glm(是否复发 ~ 术前PSA+`CAPRA-S评分`+`1014.16`, data=data, family=binomial(link=\))summary(logitMod2) Deviance Residuals: Min 1Q Median 3Q Max -1.7453 -0.5387 -0.4765 0.7288 2.6769 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.9433 1.2427 -0.759 0.447792 术前PSA 0.0903 0.4575 0.197 0.843530 `CAPRA-S评分` 1.6073 0.5108 3.147 0.001650 ** `1014.16` -1.4363 0.4010 -3.582 0.000341 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 131.851 on 98 degrees of freedom Residual deviance: 90.939 on 95 degrees of freedom AIC: 98.939 Number of Fisher Scoring iterations: 5

1328.55 #logitMod3<-glm(是否复发 ~ 术前PSA+`CAPRA-S评分`+`1328.55`, data=data, family=binomial(link=\)) summary(logitMod3)

【原创】附代码数据

有问题到淘宝找“大数据部落”就可以了 Deviance Residuals: Min 1Q Median 3Q Max -1.7580 -0.7114 -0.4417 0.6742 2.7821 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -7.4556 1.4946 -4.988 6.09e-07 *** 术前PSA 0.1220 0.4851 0.251 0.801475 `CAPRA-S评分` 1.5707 0.5431 2.892 0.003824 ** `1328.55` 1.7919 0.4662 3.844 0.000121 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 131.851 on 98 degrees of freedom Residual deviance: 86.712 on 95 degrees of freedom AIC: 94.712 Number of Fisher Scoring iterations: 5

与725.226模型比较的NRI、IDI

_________________________________________

Reclassification table

_________________________________________

Outcome: absent

Updated Model

Initial Model [0,0.5) [0.5,1] % reclassified