# Cut-off point in a ROC curve. Is there a simple function?

I want to find the cut-off point for gender based on an anthropological measurement. I can draw the curves and I know that in case sensitivity and specificity are both similarly important, the point closest to the upper left corner of the frame (or if the curve is negative, the closest point to the lower right corner) should be determined as cut-off.

However, I don't know whether there is any already implemented function in R or any other programs for determining this, simply? I just know SPSS doesn't have such a function. Do you know any programs, or R which can do it via an already implemented function?

• Hi @Vic. There is an excellent R package called ROCR for these kind of calculations. Find it here. See also the corresponding site with a comprehensive documentation. There is also a paper about the package. – COOLSerdash Jun 12 '13 at 8:30

You want to compute the Youden Index, and find the highest one in your ROC curve.

Have a look at the OptimalCutpoints package for R. If you're doing ROC analysis, you can also use the coords function of pROC (a little bit of self-advertisement here):

library(pROC)
data(aSAH)
rocobj <- roc(aSAH$outcome, aSAH$s100b)
coords(rocobj, "best")
coords(rocobj, x="best", input="threshold", best.method="youden") # Same than last line


As @COOLSerdash mentioned there is a good R package ROCR for doing this kind of analysis.

But my answer is that it is not possible to make an cut-off decision solely based on some information metric.

You should specify a true loss function which has its parameters based on some relative value of various misclassifications. It is easy then to select a cut-off point which maximizes gains or minimizes losses.

• Well said. You have to also ask yourself what is the value of having a cutoff when you can just use the predicted risk on a continuum. – Frank Harrell Jan 20 '14 at 13:11
• Vic writes that "sensitivity and specificity are both similarly important", which I interpret as the cost of the different misclassifications are identical. In this case a simple cost function like the Youden Index is appropriate (but it isn't the case in general, indeed). – Calimo Jan 20 '14 at 19:50