3

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?

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!

Gonzalo SB
  • 51
  • 2
  • 3
  • Are you keen on ROCR or did you mean "in R"? Because I don't think you can do that with ROCR, at least not directly. – Calimo Jan 30 '14 at 13:15
  • I would rather prefer to do it within ROCR, but if it can be done easily in another way I would be happy to hear about it. Thanks for answering. – Gonzalo SB Jan 30 '14 at 13:46

1 Answers1

3

As far as I know, ROCR doesn't calculate standard errors, which is why the aren't shown.

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

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).

Calimo
  • 7,510
  • 4
  • 39
  • 61