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 
====================================================\==== 
 Jarek Tuszynski, PhD.                           o / \ 
 Science Applications International Corporation  <\__,|  
 (703) 676-4192                                   ">  \ 
 [EMAIL PROTECTED]                     `   \ 



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nina Paynter
Sent: Wednesday, September 28, 2005 4:43 PM
To: [email protected]
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:

 

rocobj=rocdemo.sca(truth = ymis, data = model$fitted.values, rule =
dxrule.sca) #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?

 

Thanks,

Nina


        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to