[R] selecting cut-off in Logistic regression using ROCR package

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sat Jun 16 16:03:32 CEST 2007

Tirthadeep wrote:
> Hi,
> I am using logistic regression to classify a binary psychometric data. using
> glm() and then predict.glm() i got the predicted odds ratio of the testing
> data. Next i am going to plot ROC curve for the analysis of my study.
> Now what i will do:
> 1. first select a cut-off (say 0.4) and classify the output of predict.glm()
> into {0,1} segment and then use it to draw ROC curve using ROCR package 
> OR
> 2. just use the predicted odds ratio in ROCR package to get "error rate" and
> use the minimum error rate (as new cut-off) to draw new ROC curve.
> waiting for reply.
> with regards and thanks.
> Tirtha.

It's not clear why any cutoff or ROC curve is needed.  Please give us 
more information about why a continuous variable should be dichotomized, 
and read

   author = 		 {Royston, Patrick and Altman, Douglas G. and
Sauerbrei, Willi},
   title = 		 {Dichotomizing continuous predictors in multiple
regression: a bad idea},
   journal = 	 Stat in Med,
   year = 		 2006,
   volume =		 25,
   pages =		 {127-141},
   annote =		 {continuous
research;residual confounding;destruction of statistical inference
when cutpoints are chosen using the response variable;varying effect
estimates from change in cutpoints;difficult to interpret effects
when dichotomize;nice plot showing effect of categorization;PBC data}


Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

More information about the R-help mailing list