如何获得ROC精度的95%置信区间?

How to obtain the 95% confidence interval of accuracy of ROC ?

我已经通过pROC包得到了AUC值和95%置信区间,但是我想知道准确率的95%置信区间是怎么得到的?

data(aSAH)
myroc <- roc(aSAH$outcome, aSAH$s100b)
myroc
ci.thresholds(myroc, thresholds = "best")
ci.auc(myroc)

结果

Call:
roc.default(response = aSAH$outcome, predictor = aSAH$s100b)

Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor).
Area under the curve: 0.7314
> ci.thresholds(myroc, thresholds = "best")
95% CI (2000 stratified bootstrap replicates):
 thresholds sp.low sp.median sp.high se.low se.median se.high
      0.205 0.7083    0.8056  0.8889 0.4878    0.6341  0.7805
> ci.auc(myroc)
95% CI: 0.6301-0.8326 (DeLong)

您没有指定要计算准确度的阈值。我将展示如何获得“最佳”阈值,就像您为灵敏度和特异性所做的那样。

pROC 包有一个 coords 可以计算许多不同的度量,例如准确性。例如你可以这样做:

coords(myroc, x = "best", ret = "accuracy", transpose = FALSE)

您可以使用 ci.coords 函数获得所有这些度量的置信区间:

ci.coords(myroc, x = "best", ret = "accuracy", transpose = FALSE)