ROC Threshold Simulator

Reshape the healthy and diseased populations, change how many patients you sample, and move the cutoff. The score distributions, the ROC curve and every metric update together.

Scenarios

Score distributions

True negative False positive True positive False negative Sample histogram

ROC curve

Population Sample Current cutoff
Positive when score ≥ cutoff. Drag on either chart too.

Performance at this cutoff

Counted from the 400 sampled patients

Sensitivity · TPR
–
TP ÷ (TP + FN): diseased patients correctly flagged
Specificity · TNR
–
TN ÷ (TN + FP): healthy patients correctly cleared
PPV
–
TP ÷ all positives
NPV
–
TN ÷ all negatives
Accuracy
–
(TP + TN) ÷ N
Youden's J
–
Sens + Spec − 1
LR+
–
Sens ÷ (1 − Spec)
AUC
–

Confusion matrix

Test positiveTest negativeTotal
Diseased TP– FN– –
Healthy FP– TN– –
Total –––

What the numbers say

    Key ideas

    Sensitivity (true positive rate)
    The share of diseased patients whose score is at or above the cutoff. Raising the cutoff lowers it.
    Specificity (true negative rate)
    The share of healthy patients whose score is below the cutoff. Raising the cutoff raises it, so the two always trade off.
    ROC curve
    Every possible cutoff drawn as one point: false positive rate across, true positive rate up. Moving the cutoff slides the point along the curve. Only changing the populations changes the curve itself.
    AUC
    The area under the ROC curve. It equals the chance that a randomly chosen diseased patient scores higher than a randomly chosen healthy one. For two normal curves it is Φ((μD − μH) ÷ √(σH² + σD²)).
    Predictive values
    PPV and NPV also depend on how common the disease is. Shrink the diseased group and PPV falls even though sensitivity and specificity stay the same.
    Sample versus population
    Smooth curves are the true populations. Histograms and the stepped ROC curve come from a finite random sample, so small groups give jagged, unstable estimates.

    Evidence from the literature

    Each scenario echoes a real study from emergency or internal medicine. Press "Try it" to load the scenario, then compare what you see with the paper.