|
tree <- rpart(HCAI ~ hospital + age + gender + admseason + low_protein + UC + UN + UCN + UCL + UNL + LOS + fever + LOSICU + surnum + preoperative + postoperative + postoperative_ant + postoperative_antD + bacterial_culture + antibiotic + antibioticD + comb_ant + comb_antD + spec_ant + spec_antD + sing_antD + doub_antD + Trip_antD + blood_exam + abblood + uri_exam + aburi + ventilatorD + ventilatorT + cvcD + cvcT + uriD + uriT + add, method = "class", data = LR_train)
tree
#ROC曲线的绘制
library(pROC)
froc <- roc(LR_train$HCAI, tree$y)
froc
plot(froc, print.auc = TRUE, auc.polygon = TRUE, legacy.axes = TRUE,
grid = c(0.1, 0.2), grid.col = c("green", "red"), max.auc.polygon = TRUE,
auc.polygon.col = "skyblue", xlab = "1-specificity", ylab = "sensitivity")
ci(froc)
这样做对不对
|