Skip to content

ROC Analysis

ROC curves, AUC with confidence intervals, and the optimal classification threshold

You have a continuous marker and a binary truth - diseased vs. healthy, hit vs. miss - and you want to know how well the marker separates the two classes. The ROC curve answers that across every possible cutoff at once.

What it measures

  • Discrimination. How well the marker ranks positives above negatives, summarized by the area under the curve (AUC). 0.5 is a coin flip; 1.0 is perfect separation.
  • The sensitivity/specificity trade-off at every threshold, traced as the ROC curve.
  • The optimal cutoff, where the marker best balances catching true positives against false alarms.

Data you upload

  • A column of marker values (the continuous score or measurement).
  • A column of true labels - the known class for each sample (0/1, case/control, positive/negative).

What you get back

  • The ROC curve plotted as sensitivity vs. 1 − specificity.
  • AUC with a 95% confidence interval.
  • The optimal threshold (Youden's J by default) with the sensitivity and specificity it achieves.
  • A confusion matrix at that cutoff.

Method note

The curve is built empirically from your data - no distributional assumption about the marker. The AUC equals the probability that a randomly chosen positive scores higher than a randomly chosen negative (the Mann-Whitney interpretation), and its CI is estimated by bootstrap. The default optimal cutoff maximizes Youden's J (sensitivity + specificity − 1), but you can ask for a threshold that targets a specific sensitivity or specificity instead.

Related

For comparing the marker's mean between the two classes directly, see Group Comparison. For time-to-event outcomes rather than a binary label, see Survival Analysis. For assay validation thresholds, see Assay QC & Validation.