[R] How to calculate the area under the curve

2009-10-22 Thread olivier.abz
Hi all, I would like to calculate the area under the ROC curve for my predictive model. I have managed to plot points giving me the ROC curve. However, I do not know how to get the value of the area under. Does anybody know of a function that would give the result I want using an array of

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Frank E Harrell Jr
olivier.abz wrote: Hi all, I would like to calculate the area under the ROC curve for my predictive model. I have managed to plot points giving me the ROC curve. However, I do not know how to get the value of the area under. Does anybody know of a function that would give the result I want

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Sebastien Bihorel
Well, you can use the trapezoidal rule to numerically calculate any area under the curve. I don't know if a specific exists but you could create one. The principle is basically to compute the area between two successive points of your profile with: AREA=0.5*(Response1 + Response2)/(Time2-Time1)

Re: [R] How to calculate the area under the curve

2009-10-22 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of olivier.abz Sent: Thursday, October 22, 2009 7:23 AM To: r-help@r-project.org Subject: [R] How to calculate the area under the curve Hi all, I would like to calculate

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Ravi Varadhan
I assume that you have an ordered pair (x, y) data, where x = sensitivity, and y = 1 - specificity. Your `x' values may or may not be equally spaced. Here is how you could solve your problem. I show this with an example where we can compute the area-under the curve exactly: # Area under

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Tom Fletcher
See package ROCR. Then see ?performance; in the details, it describes a measure of auc. Tom Fletcher -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of olivier.abz Sent: Thursday, October 22, 2009 9:23 AM To: r-help@r-project.org

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Frank E Harrell Jr
I'm not clear on why we are emphasizing the trapezoidal rule when the Wilcoxon approach gives you everything plus a standard error. Frank Ravi Varadhan wrote: I assume that you have an ordered pair (x, y) data, where x = sensitivity, and y = 1 - specificity. Your `x' values may or may not