Skip to content
All lessons
Cross-cutting · Biostatistics

Diagnostic Testing: Sensitivity, Specificity & Predictive Values

A tight, boards-focused walkthrough of the diagnostic 2×2 table: sensitivity and specificity as prevalence-independent test properties versus PPV/NPV as prevalence-dependent patient answers, plus cutoff trade-offs, likelihood ratios, ROC/AUC, and the SnNOUT/SpPIN rules.

9 min readHigh yield

The 2×2 table is the whole game

Every diagnostic test is judged against a gold standard using a 2×2 contingency table that sorts patients into four cells: true positives (TP), false positives (FP), false negatives (FN), and true negatives (TN). Two distinct families of numbers fall out of this table, and the boards live in the gap between them.

  • Sensitivity & specificity describe the test itself. They are intrinsic — they do not change with disease prevalence.
  • Predictive values (PPV/NPV) describe what a result means for the patient in front of you. They shift dramatically with prevalence.

Confusing these two families is the single most tested trap in this topic.

The master 2×2

Disease +Disease
Test +TPFP
Test −FNTN
Diagram illustrating sensitivity and specificity by classifying a population of individuals into diseased and healthy groups and showing which are correctly identified as positive or negative by a test
Sensitivity and specificity derived visually from a population split by true disease status and test result. · Wikimedia Commons — FeanDoe — CC BY-SA 4.0, via Wikimedia Commons
Formulas you must know cold
  • Sensitivity = TP / (TP + FN) — proportion of diseased correctly flagged; a highly sensitive test has few false negatives
  • Specificity = TN / (TN + FP) — proportion of healthy correctly cleared; a highly specific test has few false positives
  • PPV = TP / (TP + FP) — chance a positive patient truly has disease; ↑ with prevalence
  • NPV = TN / (TN + FN) — chance a negative patient truly is disease-free; ↓ with prevalence
  • Sensitivity & specificity are prevalence-independent — intrinsic properties of the test
  • Accuracy = (TP + TN) / total

Prevalence, cutoffs, and the trade-off

Because PPV and NPV depend on how common disease is, the same test gives a low PPV in a low-prevalence screening population (most positives are false positives) but a high PPV in a high-prevalence referral clinic — the test never changed, only the population did.

Moving the cutoff for a positive result trades one property for the other:

  1. Lowering the threshold → catches more disease → ↑ sensitivity, ↓ specificity (more false positives)
  2. Raising the threshold → ↑ specificity, ↓ sensitivity (more false negatives)

You cannot maximize both at once. The ROC curve (sensitivity vs. 1 − specificity) plots this trade-off, and the area under the curve (AUC) summarizes overall discrimination: 1.0 = perfect, 0.5 = coin flip.

SnNOUT / SpPIN
  • SnNOUT — a highly Sn (sensitive) test, when Negative, rules disease OUT
  • SpPIN — a highly Sp (specific) test, when Positive, rules disease IN
  • Predictive values (PPV & NPV) hinge on Prevalence — same test, different population, different post-test answer

Side-by-side comparison

FeatureSensitivitySpecificityPPVNPV
FormulaTP/(TP+FN)TN/(TN+FP)TP/(TP+FP)TN/(TN+FN)
Reads the...Disease + columnDisease columnTest + rowTest row
Prevalence-dependent?NoNoYes (↑)Yes (↓)
Best useScreening / rule outConfirmation / rule inInterpret + resultInterpret result
RuleSnNOUTSpPIN
Likelihood ratios & ROC
  • LR+ = sensitivity / (1 − specificity); > 10 strongly rules disease in
  • LR− = (1 − sensitivity) / specificity; < 0.1 strongly rules disease out
  • Likelihood ratios are prevalence-independent (like sens/spec) and multiply pre-test odds → post-test odds (post-test odds = pre-test odds × LR)
  • LR = 1 → useless test (no change from pre-test probability)
  • ROC curve: sensitivity (y-axis) vs. 1 − specificity (x-axis); the upper-left corner is ideal, and a larger AUC = better test
How it shows up in the vignette

Classic tested moves:

  1. Screening a low-prevalence population (e.g., HIV) → start with a highly sensitive test (4th-generation antigen/antibody combination immunoassay, which detects p24 antigen + HIV-1/2 antibodies) so you miss almost no cases, then confirm reactive results with a highly specific test (the HIV-1/2 antibody differentiation immunoassay; the older Western blot has been retired from the current CDC algorithm) to purge false positives.
  2. "A test's PPV rises when moved to a sicker clinic population" → prevalence effect, not a change in the test.
  3. "Lowering the glucose cutoff for diabetes screening" → ↑ sensitivity, ↓ specificity → more false positives.
  4. A negative highly-sensitive test in a symptomatic patient → confident enough to rule out (SnNOUT); a positive highly-specific test → confident enough to rule in (SpPIN).

Practice Biostatistics now

Board-style questions, spaced-repetition flashcards, and a Socratic AI tutor — free to start.