ROC AUC Calculator
Area under the ROC curve from the scores of positive and negative cases — AUC, Hanley–McNeil standard error and 95% CI, Gini, the best Youden cut-off and the ROC table.
How it works
AUC = [#(pos > neg) + ½·#(ties)] ÷ (n₁·n₀) = U ÷ (n₁n₀); SE = √{[A(1−A) + (n₁−1)(Q₁−A²) + (n₀−1)(Q₂−A²)] ÷ (n₁n₀)}, Q₁ = A/(2−A), Q₂ = 2A²/(1+A); Youden J = sensitivity + specificity − 1
The area under the ROC curve is the probability that a randomly chosen positive case gets a higher score than a randomly chosen negative case — exactly the Mann–Whitney U statistic divided by n₁n₀. It summarises how well a model, biomarker or test separates the classes over every possible threshold. The standard error follows Hanley & McNeil (1982); the descriptive bands (0.7 acceptable, 0.8 excellent, 0.9 outstanding) are from Hosmer & Lemeshow.
Worked example
Eight positive and ten negative scores: 73 of the 80 positive–negative pairs are ranked correctly, so AUC = 0.9125 (95% CI 0.763 to 1.000) and Gini = 0.8250; the best cut-off is ≥ 0.45 with 100.0% sensitivity and 70.0% specificity — outstanding discrimination.
Sources: Hanley & McNeil (1982), The meaning and use of the area under a ROC curve, Radiology · scikit-learn — roc_auc_score
Frequently asked questions
What does an AUC of 0.5 mean?
The scores separate positives and negatives no better than a coin flip. 1.0 is perfect separation; below 0.5 means the scores are reversed.
How is AUC related to the Mann–Whitney test?
AUC = U/(n₁n₀). Testing whether AUC differs from 0.5 is the same as the Mann–Whitney U test.
Which cut-off should I use?
The Youden index picks the threshold that maximises sensitivity + specificity, but the right cut-off depends on the costs of false positives and false negatives.
Is AUC good for imbalanced data?
AUC ignores class prevalence, so with very rare positives a precision–recall curve (and the F1 score) is often more informative.
Related calculators
Educational tool: check the test’s assumptions (sample size, independence, distribution) before relying on a result for a real decision.