01 / 22
✓ ✕ ✕ ✓

Sensitivity &
Specificity

Master the two pillars of diagnostic test evaluation: learn to calculate and interpret sensitivity and specificity using the \(2 \times 2\) confusion matrix.

Biostatistics

What Is a Diagnostic Test?

A diagnostic test classifies individuals as either positive (likely having a condition) or negative (likely not having it). But no test is perfect: some results are right, and some are wrong.

True Result
The test agrees with the patient's actual disease status.
False Result
The test disagrees with the patient's actual disease status.

The Four Possible Outcomes

TP: True Positive
Has disease, test says positive.
TN: True Negative
No disease, test says negative.
FP: False Positive
No disease, test says positive.
FN: False Negative
Has disease, test says negative.

The \(2 \times 2\) Confusion Matrix

Actual Condition
Disease \(+\)
No Disease \(-\)
Test Result
Test \(+\)
Test \(-\)
TP FP FN TN
\(TP + FN = \text{All Diseased}\)
\(FP + TN = \text{All Healthy}\)

Defining Sensitivity

Sensitivity (also called the True Positive Rate) measures the proportion of people who actually have the disease that the test correctly identifies as positive.

A highly sensitive test catches nearly all truly sick patients. Think: Snout: a highly Sensitive test, when negative, rules the disease out.

Defining Specificity

Specificity (also called the True Negative Rate) measures the proportion of people who do not have the disease that the test correctly identifies as negative.

A highly specific test rarely flags healthy people. Think: Spin: a highly Specific test, when positive, rules the disease in.

Sensitivity vs Specificity

Sensitivity Specificity
Question answered Of the sick, how many test \(+\)? Of the healthy, how many test \(-\)?
Formula \(\frac{TP}{TP+FN}\) \(\frac{TN}{TN+FP}\)
Denominator is All with disease All without disease
Mnemonic SnOUT SpIN
Error it minimizes False Negatives False Positives

The Trade-off Between Them

Threshold (Cutoff Value) Rate (%) 0 50 100 Sensitivity Specificity Optimal?

When to Prioritize Each

High Sensitivity
Screening tests, life-threatening conditions. Missing a case (FN) is dangerous. Example: HIV screening.
High Specificity
Confirmatory tests, costly treatments. A false alarm (FP) has serious consequences. Example: biopsy confirmation.

How to Calculate Step by Step

1
Build the \(2 \times 2\) table. Organize data into TP, FP, FN, and TN cells.
2
Identify the column. Sensitivity uses the Disease (\(+\)) column. Specificity uses the No Disease (\(-\)) column.
3
Compute the ratio. Sensitivity: \(\frac{TP}{TP + FN}\). Specificity: \(\frac{TN}{TN + FP}\).
4
Convert to percent. Multiply by 100 to express as a percentage.
5
Interpret. Relate the result back to the clinical question and consider the trade-off.

Example 1: Flu Rapid Test

A rapid flu test is used on 200 patients. Results: TP = 80, FP = 10, FN = 20, TN = 90. Calculate sensitivity and specificity.

TP = 80
Disease \(+\), Test \(+\)
FP = 10
No Disease, Test \(+\)
FN = 20
Disease \(+\), Test \(-\)
TN = 90
No Disease, Test \(-\)
Test \(+\)
Test \(-\)
Disease \(+\)
No Disease \(-\)

Example 2: Cancer Screening

A mammography study on 1,000 women yields: TP = 45, FP = 95, FN = 5, TN = 855.

Example 3: Finding Missing Values

A test with \(\text{sensitivity} = 95\%\) is applied to 400 patients who have the disease. How many true positives and false negatives result?

1
All 400 have the disease, so \(TP + FN = 400\).
2
Sensitivity \(= \frac{TP}{400} = 0.95\), so \(TP = 0.95 \times 400 = 380\).
3
\(FN = 400 - 380 = 20\). These 20 sick patients are missed.

Complementary Error Rates

False Negative Rate
\(\text{FNR} = 1 - \text{Sensitivity} = \frac{FN}{TP + FN}\)
False Positive Rate
\(\text{FPR} = 1 - \text{Specificity} = \frac{FP}{TN + FP}\)

Prevalence and Predictive Values

Sensitivity and specificity are intrinsic properties of the test: they do not change with prevalence. But predictive values do change:

PPV
Positive Predictive Value: \(\frac{TP}{TP+FP}\). Probability that a positive result is truly positive.
NPV
Negative Predictive Value: \(\frac{TN}{TN+FN}\). Probability that a negative result is truly negative.

Common Mistakes

✕ Wrong Denominator
Using the total population instead of only the diseased (sensitivity) or only the healthy (specificity).
✕ Swapping Formulas
Confusing sensitivity with PPV. Sensitivity conditions on disease status; PPV conditions on test result.
✕ Ignoring Prevalence
Assuming high sensitivity means most positives are correct. Low prevalence can make PPV very low.

Summary of Key Measures

Measure Formula Conditions On
Sensitivity \(\frac{TP}{TP+FN}\) Disease present
Specificity \(\frac{TN}{TN+FP}\) Disease absent
PPV \(\frac{TP}{TP+FP}\) Test positive
NPV \(\frac{TN}{TN+FN}\) Test negative
FNR \(1 - \text{Sensitivity}\) Disease present
FPR \(1 - \text{Specificity}\) Disease absent

Question 1 of 5

A test has \(TP = 90\), \(FN = 10\), \(FP = 30\), and \(TN = 870\). What is the sensitivity?

Question 2 of 5

Using the same data (\(TP = 90\), \(FN = 10\), \(FP = 30\), \(TN = 870\)), what is the specificity?

Question 3 of 5

A screening test has a \(\text{sensitivity} = 98\%\). What is the false negative rate?

Question 4 of 5

A disease has very low prevalence. Even with \(95\%\) sensitivity and \(95\%\) specificity, the PPV will likely be:

Question 5 of 5

You want a test to rule out a dangerous disease. You should prioritize a test with high: