[R] Re : ROC Analysis

Pascal Oettli kridox at ymail.com
Wed Mar 14 04:43:10 CET 2012


Hi Camille,

Do you need something like that?

###################
library(ROCR)

data(ROCR.simple)
pred <- prediction(ROCR.simple$predictions, ROCR.simple$labels)

tpf <- unlist(performance(pred,"tpr")@y.values)
tnf <- unlist(performance(pred,"tnr")@y.values)
x <- rev(unlist(pred at cutoffs))

plot(x, tpf+tnf, t='l', xlab='Value', ylab='TPF+TNF')
###################


Regards,
Pascal

----- Mail original -----
De : Camille Leclerc <camille.leclerc at ymail.com>
À : r-help at r-project.org
Cc : 
Envoyé le : Mardi 13 mars 2012 23h30
Objet : [R] ROC Analysis

Hi everybody,

I have a data set with a value and a status (positive or negative case) and
I want make a ROC Analysis. So, with ROCR Package, I have got the ROC curve
(True Positive Fraction [tpf] according 1-True Negative Fraction [1-tnf]).

http://r.789695.n4.nabble.com/file/n4469203/01.png 

But, now I want a new graphic which show the sum of true positive fraction
and true negative fraction according each value on my data set (tpf + tnf
according the values). 

http://r.789695.n4.nabble.com/file/n4469203/02.png 

If you have an idea !

Thank you very much for all help,
Camille Leclerc

--
Camille Leclerc, Master student
Lab ESE, UMR CNRS 8079
Univ Paris-Sud
Bat 362
F-91405  Orsay Cedex FRANCE



--
View this message in context: http://r.789695.n4.nabble.com/ROC-Analysis-tp4469203p4469203.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.




More information about the R-help mailing list