ROC curves, sensitivity, and specificity are foundational concepts in biostatistics, epidemiology, and machine learning. NYC students encounter them in public health, medical statistics, and data science courses. This guide explains each concept clearly and shows how they fit together.
1. Sensitivity and Specificity
Diagnostic accuracy begins with the 2×2 table:
\[ \begin{array}{c|cc} & \text{Disease} & \text{No Disease} \\ \hline \text{Test +} & TP & FP \\ \text{Test –} & FN & TN \\ \end{array} \]
Sensitivity
\[ \text{Sensitivity} = \frac{TP}{TP + FN} \]
“Of all people who truly have the disease, how many test positive?”
Specificity
\[ \text{Specificity} = \frac{TN}{TN + FP} \]
“Of all people who do not have the disease, how many test negative?”
Sensitivity and specificity are properties of the test itself — they do not depend on disease prevalence.
2. Why Sensitivity and Specificity Trade Off
Most diagnostic tests use a continuous score (e.g., biomarker level, risk score). Choosing a threshold determines who is labeled “positive.”
- Lower threshold → more positives → higher sensitivity, lower specificity
- Higher threshold → fewer positives → lower sensitivity, higher specificity
This trade‑off is the foundation of the ROC curve.
3. ROC Curve: Definition
The ROC curve plots:
- Sensitivity on the y‑axis
- 1 – Specificity (false positive rate) on the x‑axis
Each point corresponds to a different threshold.
\[ \text{ROC point} = (\text{FPR}, \text{TPR}) = (1 – \text{Specificity}, \text{Sensitivity}) \]
A perfect test reaches the top‑left corner (0, 1). A useless test lies on the diagonal.
4. Area Under the Curve (AUC)
The AUC summarizes the ROC curve into a single number:
\[ AUC = P(\text{Test score for diseased} > \text{Test score for non‑diseased}) \]
Interpretation:
- 0.5 → no better than chance
- 0.7–0.8 → acceptable
- 0.8–0.9 → good
- 0.9+ → excellent
AUC is threshold‑free, making it useful for comparing models.
5. Example: Changing the Threshold
Suppose a risk score ranges from 0 to 1. Consider three thresholds:
- Threshold = 0.2 → high sensitivity, low specificity
- Threshold = 0.5 → balanced sensitivity and specificity
- Threshold = 0.8 → low sensitivity, high specificity
Plotting these three points begins to trace the ROC curve.
6. ROC vs. Precision–Recall
ROC curves are stable when the negative class is large. But when the disease is rare, precision–recall curves may be more informative because they incorporate prevalence.
ROC: threshold‑free, prevalence‑independent.
PR: sensitive to prevalence, highlights false positives.
7. Common NYC Exam Questions
- Compute sensitivity and specificity from a 2×2 table
- Explain why sensitivity and specificity trade off
- Interpret an ROC curve and AUC value
- Compare two diagnostic tests using AUC
- Explain why ROC curves do not depend on prevalence
Mastering these concepts is essential for biostatistics, epidemiology, and machine learning coursework.
Internal Links (NYC Architecture)
Biostatistics & Epidemiology Tutoring NYC
Statistics Tutoring NYC
Statistics Blog Hub
Statistical Inference Tutoring NYC

Leave a Reply