Re: [R] calculate AUC for ROC curve

From: Frank E Harrell Jr <>
Date: Tue 19 Sep 2006 - 15:46:00 GMT

Guoyan Zhao wrote:
> Dear everyone,
> I have only tpr (true positive rate) and fpr (false positive rate) which
> were used to plot the ROC curve. Is there any way I can calculate the AUC
> for this curve using just this information? Any help is highly
> appreciated.
> Isabel

To get the AUC you need N pairs of (predicted probability or log odds, binary outcome). AUC is quickly computed with the Hmisc somers2 function and you can get a std. error for it from the Hmisc rcorr.cens function. You can also compute AUC from the way you stated it but that is a roundabout way.


Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed Sep 20 01:49:29 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 19 Sep 2006 - 16:30:58 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.