Re: [R] area under roc curve

From: Frank Harrell <f.harrell_at_vanderbilt.edu>
Date: Wed, 13 Apr 2011 15:20:23 -0700 (PDT)

ROC area does not measure goodness of prediction but does measure pure predictive discrimination. The generalization of the ROC area is the C-index for continuous or censored Y. See for example the rcorr.cens function in the Hmisc package.
Frank

agent dunham wrote:
>
> Dear all,
>
>
> I want to measure the goodness of prediction of my linear model. That's
> why I was thinking about the area under roc curve.
>
> I'm trying the following, but I don't know how to avoid the error. Any
> help would be appreciated.
>
> library(ROCR)
>
> model.lm <- lm(log(outcome)~log(v1)+log(v2)+factor1)
> pred<-predict(model.lm)
> pred<-prediction(as.numeric(pred), as.numeric(log(outcome)))
> auc<-performance(pred,"auc")
>
> Error en prediction(as.numeric(pred), as.numeric(log(outcome))) :
> Number of classes is not equal to 2.
> ROCR currently supports only evaluation of binary classification tasks.
> user@host.com
>



Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context: http://r.789695.n4.nabble.com/area-under-roc-curve-tp3447420p3448377.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 13 Apr 2011 - 22:23:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 13 Apr 2011 - 22:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive