如何在ROCR中获得AUC的标准误?

时间:2021-05-21 20:35:55

I'm using ROCR to obtain the AUC indices. I want to have also the standard errors of the AUC but in the default outputs they are not shown. Is there any way of obtaining them?

我正在使用ROCR获得AUC指数。我想也有AUC的标准错误,但在默认输出中它们没有显示。有没有办法获得它们?

Example:

例:

library(ROCR)
a<-rnorm(100,1)
b<-sample(0:1,100,TRUE)
pred<-prediction(a,b)
auc<-performance(pred,"auc")
auc@y.values

Thanks in advance for any help!

在此先感谢您的帮助!

1 个解决方案

#1


1  

As far as I know are not calculated by ROCR, which is why the aren't shown.

据我所知,不是由ROCR计算的,这就是为什么没有显示。

You can obtain them with the pROC package (disclaimer: I am its main author).

您可以使用pROC包获得它们(免责声明:我是它的主要作者)。

myROC <- roc(b, a) 
var(myROC)

Take the square root to obtain the standard deviation, which in this case is the standard error (because the AUC is a sample-mean).

取平方根得到标准偏差,在这种情况下是标准误差(因为AUC是样本均值)。

#1


1  

As far as I know are not calculated by ROCR, which is why the aren't shown.

据我所知,不是由ROCR计算的,这就是为什么没有显示。

You can obtain them with the pROC package (disclaimer: I am its main author).

您可以使用pROC包获得它们(免责声明:我是它的主要作者)。

myROC <- roc(b, a) 
var(myROC)

Take the square root to obtain the standard deviation, which in this case is the standard error (because the AUC is a sample-mean).

取平方根得到标准偏差,在这种情况下是标准误差(因为AUC是样本均值)。