Re: [R] Fast AUC computation

From: Tuszynski, Jaroslaw W. <>
Date: Fri 30 Sep 2005 - 01:03:24 EST

See colAUC in caTools (there is a problem with 1.3 version, 1.4 is on the way). See "examples" for other functions calculating AUC. An alternative approach is:

	  x1 = x[y==1]; n1 = length(x1); 
	  x2 = x[y==0]; n2 = length(x2);
	  r = rank(c(x1,x2))  
        auc = (sum(r[1:n1]) - n1*(n1+1)/2) / (n1*n2) 

Which is very fast.


 Jarek Tuszynski, PhD.                           o / \ 
 Science Applications International Corporation  <\__,|  
 (703) 676-4192                                   ">  \                     `   \ 

-----Original Message-----
[] On Behalf Of Nina Paynter Sent: Wednesday, September 28, 2005 4:43 PM To:
Subject: [R] Fast AUC computation

I am doing a simulation with a relatively large data set (20,000 observations) for which I want to calculate the area under the Receiver Operator Curve (AUC) for many parameter combinations. I am using the ROC library and the following commands to generate each AUC: = ymis, data = model$fitted.values, rule = #generation of observed ROC object

aucobj=AUC(rocobj) #pulling out just the observed AUC - trapezoidal not integrated  

but they are pretty slow.  

Does anyone know of a faster way to get the AUC?  



        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Fri Sep 30 01:08:55 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:59:51 EST