[R] AUC calculated from Epi package

array chip arrayprofile at yahoo.com
Mon Jun 20 23:10:21 CEST 2011


Hi, I have a dataset (see attached) with 2 variables "Y" is binary, "x" is a 
continuous variable. I want to calculate area under the curve (AUC) for the ROC 
curve, but I got different AUC values using ROC() from Epi package vs. 
rcorr.cens() from rms package:

test<-read.table("test.txt",sep='\t',header=T,row.names=NULL)
y<-test$y
x<-test$x
library(Epi)
ROC(form=y~x,plot="ROC")

library(rms)
rcorr.cens(x,y)
lrm(y~x)

As you can see, ROC() gave an AUC 0.782, while both rcorr.cens() and lrm() 
(C-index) gave AUC 0.813. That's a big difference. And I believe rms package 
gave me correct answer. But anyone have any clue about the difference?

Thanks

John
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110620/2749a93a/attachment.txt>


More information about the R-help mailing list