[R] How to compare areas under ROC curves calculated with ROCR package

Laurent Fanchon lfanchon at vet-alfort.fr
Wed Mar 15 17:57:05 CET 2006


Dear all,

I try to compare the performances of several parameters to diagnose 
lameness in dogs.
I have several ROC curves from the same dataset.
I plotted the ROC curves and calculated AUC with the ROCR package.

I would like to compare the AUC.
I used the following program I found on R-help archives :
 
From: Bernardo Rangel Tura
Date: Thu 16 Dec 2004 - 07:30:37 EST

seROC<-function(AUC,na,nn){
a<-AUC
q1<-a/(2-a)
q2<-(2*a^2)/(1+a)
se<-sqrt((a*(1-a)+(na-1)*(q1-a^2)+(nn-1)*(q2-a^2))/(nn*na))
se
}

cROC<-function(AUC1,na1,nn1,AUC2,na2,nn2,r){
se1<-seROC(AUC1,na1,nn1)
se2<-seROC(AUC2,na2,nn2)

sed<-sqrt(se1^2+se2^2-2*r*se1*se2)
zad<-(AUC1-AUC2)/sed
p<-dnorm(zad)
a<-list(zad,p)
a
}

The author of this script says: "The first function (seROC) calculate the standard error of ROC curve, the 
second function (cROC) compare ROC curves."

What do you think of this script?
Is there any function to do it better in ROCR?

Any help would be greatly appreciated. 

Laurent Fanchon
DVM, MS
Ecole Nationale Vétérinaire d'Alfort
FRANCE




More information about the R-help mailing list