> install.packages('pROC') 安装pROC包
> install.packages('ggplot2')安装ggplot2包
> library(pROC) 调用pROC包
> library(ggplot2) 安装ggplot包
> data(aSAH) 引入案例数据
> View(aSAH) 展示案例数据
> roca<>
> rocb<>
> rocc<>
> auc(roca)
Area under the curve: 0.7314
> auc(rocb)
Area under the curve: 0.8237
> auc(rocc)
Area under the curve: 0.612
> plot(roca)
> plot(rocb)
> plot(rocc)
> roc.test(roca,rocb,method = 'delong') ROC曲线下面积的比较
DeLong's test for two correlated ROC curves
data: roca and rocb
Z = -2.209, p-value = 0.02718
alternative hypothesis: true difference in AUC is not equal to 0
sample estimates:
AUC of roc1 AUC of roc2
0.7313686 0.8236789
> g3<>
> g3
联系客服