[R] Computing Confidence Intervals for AUC in ROCR Package

Na'im R. Tyson ntyson at clovermail.net
Fri Jan 22 09:53:39 CET 2010


Dear R-philes,

I am plotting ROC curves for several cross-validation runs of a  
classifier (using the function below).  In addition to the average  
AUC, I am interested in obtaining a confidence interval for the  
average AUC.  Is there a straightforward way to do this via the ROCR  
package?

plot_roc_curve <- function(roc.dat, plt.title) {
	#print(str(vowel.ROC))
	pred <- prediction(roc.dat$predictions, roc.dat$labels)
	perf <- performance(pred, "tpr", "fpr")
	perf.auc <- performance(pred, "auc")
	perf.auc.areas <- slot(perf.auc, "y.values")
	curve.area <- mean(unlist(perf.auc.areas))
	#quartz(width=4, height=6)
	plot(perf, col="grey82", lty=3)
	plot(perf,lwd=3,avg="horizontal",spread.estimate="boxplot",
		add=T)
	title(main=plt.title)
	mtext(sprintf("%s%1.4f", "Area under Curve = ", curve.area),
		side=3, line=0, cex=0.8)
}

P.S. After years of studying statistical analysis as a student, I  
still consider myself a novice.



More information about the R-help mailing list