Reclassification là một phương pháp dùng để đánh giá tác động của mô hình được cập nhật so với mô hình ban đầu về tác động làm thay đổi ý kiến người sử dụng. {PredictABEL} hàm reclassification được dùng để thực hiện.
head (dt)
## id fu.days status drug age sex ascites
## 1 1 400 death penicillamine 21464 female 1
## 2 2 4500 censored penicillamine 20617 female 0
## 3 3 1012 death penicillamine 25594 male 0
## 4 4 1925 death penicillamine 19994 female 0
## 5 5 1504 censored due to liver tx placebo 13918 female 0
## 6 6 2503 death placebo 24201 female 0
## hepatom spiders edema bili chol albumin copper alk.phos sgot trig
## 1 1 1 1.0 14.5 261 2.60 156 1718.0 137.95 172
## 2 1 1 0.0 1.1 302 4.14 54 7394.8 113.52 88
## 3 0 0 0.5 1.4 176 3.48 210 516.0 96.10 55
## 4 1 1 0.5 1.8 244 2.54 64 6121.8 60.63 92
## 5 1 1 0.0 3.4 279 3.53 143 671.0 113.15 72
## 6 1 0 0.0 0.8 248 3.98 50 944.0 93.00 63
## platelet protime stage
## 1 190 12.2 4
## 2 221 10.6 3
## 3 151 12.0 4
## 4 183 10.3 4
## 5 136 10.9 3
## 6 NA 11.0 3
dt$outcome [dt$status=='death']= 1
dt$outcome [dt$status!='death']= 0
dt= na.omit (dt)
attach (dt)
library(PredictABEL)
m1= glm(outcome ~ age + factor(ascites) + bili + copper + alk.phos + sgot + protime, family = binomial)
m2= glm (outcome ~ age + bili + alk.phos+ protime, family=binomial)
predRisk1 = predRisk (m1)
predRisk2 = predRisk (m2)
reclassification (data= dt, cOutcome= 21, predrisk1= predRisk1, predrisk2= predRisk2, cutoff= c(0, 0.35, 0.7, 1))
## _________________________________________
##
## Reclassification table
## _________________________________________
##
## Outcome: absent
##
## Updated Model
## Initial Model [0,0.35) [0.35,0.7) [0.7,1] % reclassified
## [0,0.35) 123 6 0 5
## [0.35,0.7) 9 17 3 41
## [0.7,1] 0 0 7 0
##
##
## Outcome: present
##
## Updated Model
## Initial Model [0,0.35) [0.35,0.7) [0.7,1] % reclassified
## [0,0.35) 15 7 0 32
## [0.35,0.7) 7 24 3 29
## [0.7,1] 0 6 49 11
##
##
## Combined Data
##
## Updated Model
## Initial Model [0,0.35) [0.35,0.7) [0.7,1] % reclassified
## [0,0.35) 138 13 0 9
## [0.35,0.7) 16 41 6 35
## [0.7,1] 0 6 56 10
## _________________________________________
##
## NRI(Categorical) [95% CI]: -0.027 [ -0.1254 - 0.0714 ] ; p-value: 0.5904
## NRI(Continuous) [95% CI]: -0.5235 [ -0.754 - -0.2931 ] ; p-value: 1e-05
## IDI [95% CI]: -0.0369 [ -0.0591 - -0.0147 ] ; p-value: 0.00115