Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: cutoff point for ROC curve

From   Steve Samuels <>
Subject   Re: st: Re: cutoff point for ROC curve
Date   Sun, 13 Oct 2013 09:34:49 -0400

Correction: one wants to see the cutoff that gives the *maximum* of Youden's index, not the minimum. See:
which gives the source:

Youden W. J., "Index for rating diagnostic tests.", Cancer 1950; 3: 32-35

The code was correct.


I don't think there is a "best" cut-off value.  I also like to see the value that gives the minimum of  Youden's index, which is sensitivity - (1 - specificity) or
P(D+|T+) -P(D+|T-) (or "true positive rate" - "false positive rate"). To do the
calculation, down load Roger Newson's -senspec- from SSC.

sysuse auto, clear
logistic foreign mpg turn

predict pr, pr
cap which senspec
if _rc {
ssc install senspec

senspec foreign pr, sensitivity(sens) specificity(spec)
codebook sens spec

gen youden= sens-(1-spec)
egen youdenmax= max(youden)
gen best_youden =    abs(youden -youdenmax)<0.0001

gen dist = sqrt((1-sens)^2 + (1-spec)^2)
egen distmax = min(dist)
gen best_dist =  abs(dist-distmax)<0.0001
format pr sens spec youden* dist* %6.5f

list best* make pr youden* dist* if best_youden | best_dist


On Oct 13, 2013, at 7:03 AM, Michael Stewart wrote:

HI ,
I am working with Prediction/classification using logistic regression
and have question regarding ROC  curves.I was hoping to get help from
the Statalist community.
After  running the logistic regression , predict, my understanding is
that lsens gives a graphical presentation of the AUC with various cut
If I need  to  find  the best cut off value ( usually defined as
minimal sum of (1-sensitivity)^2 + (1-specificity)^2); is there a good
way / command to tabulate the results .

Thank  you very much for your time

Thank you ,
Yours Sincerely,
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index