Skip to content
Prev 243973 / 398506 Next

HOW to use the survivalROC to get optimal cut-off values?

On Dec 5, 2010, at 11:33 AM, David Winsemius wrote:

            
Snipped comments about small nubers of discrete values as that was a  
misunderstanding on my part.
I really do not understand what you are asking when you ask about "5  
values". (I also see that another student GY QIAN in SHANGHAI,CHINA  
asked almost the same odd question on rhelp about 6 weeks ago making  
me wonder if there is some online class you are both taking for which  
this is homework?)

  There are 312 finite values for each of cut.values, FP, and TP. Is  
someone, your course instructor or collaborator, asking for a  
comparison at 5 selected cutpoints? I generally use Hmisc::describe  
for quick looks:
 > describe(ROC.1$cut.values[-1])
ROC.1$cut.values[-1]
       n missing  unique    Mean     .05     .10     .25     .50     . 
75     .90     .95
     312       0     312   6.538   5.320   5.459   5.842   6.312    
6.949   7.966   8.675

lowest :  4.581  4.900  4.926  4.932  4.946, highest:  9.510  9.568  
10.185 10.479 10.629


You could programmatically ask what values of the index (1:313)   
minimizes the sum of FN and (1-TP) = FP. And then you can use to index  
the TP and "FP" values. I guess it is common practice to call 1- 
specificity the "false positive rate" but I for one find that very  
confusing. even misleading, since it's not clear from the term what  
the denominator for such a "rate" really should be.  (It's also not  
really a rate since no time is involved in the calculation.) At any  
rate, as it were:

 > with(ROC.1, which.min(1-TP+ FP))
[1] 259

 > with(ROC.1, points(FP[259], TP[259], cex=3, col="red" ))