med study partner

Articles & Guides › Articles › Biostatistics & Public Health

Sensitivity, specificity and predictive values

How to build a diagnostic 2 by 2 table and read sensitivity and specificity down its columns and predictive values across its rows, why prevalence changes predictive values but not the test itself, and what moving a cutoff or combining two tests does to every measure.

Biostatistics & Public Health · 7 min read · Reviewed 2026-11-17

Every diagnostic test question starts the same way: build the 2 by 2 table, then read down or across it. The arithmetic is easy. The hard part is knowing which direction answers which question, because a test's performance can be described from two different starting points: what the test does to people whose disease status we already know, and what a result means for the person holding it.

Key points

  • Sensitivity and specificity start from the truth and are read down the columns; they belong to the test and don't change with prevalence.
  • Predictive values start from the result and are read across the rows; they are what a patient wants to know, and they depend on prevalence.
  • As prevalence rises, PPV rises and NPV falls; a positive screen in a low-prevalence population is often a false positive.
  • SnNout: a very sensitive test, when negative, rules disease out. SpPin: a very specific test, when positive, rules it in.
  • Lowering a cutoff raises sensitivity and NPV and lowers specificity and PPV; testing in series raises specificity, in parallel raises sensitivity.

Sensitivity and specificity

The 2 by 2 table

Put the test result in the rows and the true disease status, decided by a gold standard, in the columns[1].

Disease presentDisease absent
Test positiveTrue positive (TP), aFalse positive (FP), b
Test negativeFalse negative (FN), cTrue negative (TN), d

Reading down the columns

  • Sensitivity = TP ÷ (TP + FN) = a ÷ (a + c). Of the people who have the disease, what fraction test positive? It is the true positive rate, and 1 − sensitivity is the false negative rate.
  • Specificity = TN ÷ (TN + FP) = d ÷ (b + d). Of the people who don't have the disease, what fraction test negative? It is the true negative rate, and 1 − specificity is the false positive rate.

Both start from the truth and ask what the test did, so they don't depend on how common the disease is: they are properties of the test[1,2]. They can still shift with the mix of patients. A test validated on obvious, advanced cases may look more sensitive than it will be in early, mild disease, which is called spectrum bias.

For example, a rapid test is tried on 400 people with a condition and 600 without, all checked with the gold standard. It is positive in 360 of the 400 and in 120 of the 600. Sensitivity is 360 ÷ 400 = 90%. Of the 600 without the condition, 480 test negative, so specificity is 480 ÷ 600 = 80%.

SnNout and SpPin

  • A highly Sensitive test, when Negative, rules disease out. It rarely misses disease, so a negative result is reassuring. Sensitive tests suit screening and excluding dangerous conditions, such as a D-dimer in a patient at low risk of pulmonary embolism, or an HIV screening immunoassay.
  • A highly Specific test, when Positive, rules disease in. It rarely gives false positives, so a positive result is convincing. Specific tests suit confirmation before treatment that is risky, costly or life-changing, such as the confirmatory HIV assay after a positive screen, or a biopsy.

Accuracy

Accuracy = (TP + TN) ÷ total, the share of all results that are correct. In the example above it is (360 + 480) ÷ 1,000 = 84%. Accuracy folds false positives and false negatives into one number and hides the trade-off between them, so it is rarely the most useful measure[2].

Predictive values and prevalence

Reading across the rows

  • Positive predictive value (PPV) = TP ÷ (TP + FP) = a ÷ (a + b). Of the people who test positive, what fraction actually have the disease?
  • Negative predictive value (NPV) = TN ÷ (TN + FN) = d ÷ (c + d). Of the people who test negative, what fraction are truly free of it?

These answer the patient's question: "My test is positive. How likely is it that I have the disease?"[3]

Prevalence moves the predictive values

Prevalence, or the pretest probability, is (TP + FN) ÷ total. With the test unchanged, a population with more disease has more true positives among its positives and more missed cases among its negatives[3].

When prevalence risesEffect
PPVRises
NPVFalls
Sensitivity and specificityNo change

Working it through

The reliable method is to choose a round population, fill in the disease column from the prevalence, apply sensitivity to the people with disease and specificity to the people without, and then read across.

Take a test with a sensitivity of 85% and a specificity of 95%, used in 10,000 people.

Prevalence 1%Prevalence 20%
People with disease100: 85 TP, 15 FN2,000: 1,700 TP, 300 FN
People without disease9,900: 9,405 TN, 495 FP8,000: 7,600 TN, 400 FP
PPV85 ÷ 580, about 15%1,700 ÷ 2,100, about 81%
NPV9,405 ÷ 9,420, about 99.8%7,600 ÷ 7,900, about 96%

When only 1% of people have the disease, more than five of every six positives are false, even with 95% specificity. This is why a positive screening test in the general population usually needs confirmation, and why the same test seems to "work better" in a specialist clinic, where the pretest probability is higher[4].

Changing the cutoff and combining tests

Moving the cutoff

Many tests give a continuous result, such as a blood level, and a cutoff decides what counts as positive. The values in people with and without disease overlap, so any cutoff trades false negatives against false positives[2]. For a test where higher values suggest disease:

ChangeSensitivitySpecificityPPVNPVFalse negativesFalse positives
Lower the cutoff: more people called positiveUpDownDownUpFewerMore
Raise the cutoff: fewer people called positiveDownUpUpDownMoreFewer

Choose a low cutoff (high sensitivity) when missing the disease is dangerous, it can be treated and a confirmatory test is available. Choose a high cutoff (high specificity) when a false positive would lead to harmful, costly or stigmatizing follow-up. If a hospital lowers its troponin cutoff for myocardial infarction, more true infarctions are caught and a negative result becomes more reassuring, but more patients without infarction are labeled positive.

Moving the cutoff doesn't make a test better; it only slides along the same trade-off. A truly better test separates the two groups more cleanly, which shows as a higher ROC curve.

Combining two tests

  • In series (sequential): the second test is done only if the first is positive, and a person is called positive only if both are positive. Specificity rises and sensitivity falls. This is the screen-then-confirm strategy used for HIV.
  • In parallel (simultaneous): both tests are done, and a person is called positive if either is positive. Sensitivity rises and specificity falls. It suits settings where missing disease is unacceptable, such as an emergency evaluation.

If two tests err independently, the numbers follow directly. Test A has a sensitivity of 90% and a specificity of 80%; test B has 80% and 90%.

StrategySensitivitySpecificity
Series (both positive)0.9 × 0.8 = 72%1 − (0.2 × 0.1) = 98%
Parallel (either positive)1 − (0.1 × 0.2) = 98%0.8 × 0.9 = 72%

In practice, tests that measure the same thing tend to fail in the same patients, so the real gain is usually smaller than this calculation suggests[2].

Common confusions

  • Sensitivity versus PPV: sensitivity starts with the disease (of the diseased, how many test positive); PPV starts with the result (of the positives, how many are diseased).
  • "95% specific" does not mean a positive is 95% likely to be right. In a population with 1% prevalence, most positives are false.
  • Prevalence changes predictive values, not sensitivity or specificity. Spectrum bias can change sensitivity and specificity, but that comes from a different mix of patients, not from how common the disease is.
  • Series versus parallel: series (both must be positive) raises specificity; parallel (either may be positive) raises sensitivity.

References

  1. Altman DG, Bland JM. Diagnostic tests 1: sensitivity and specificity. BMJ. 1994;308(6943):1552. doi:10.1136/bmj.308.6943.1552 Link ↩
  2. Celentano DD, Szklo M. Gordis Epidemiology. 6th ed. Elsevier; 2019. ↩
  3. Altman DG, Bland JM. Diagnostic tests 2: predictive values. BMJ. 1994;309(6947):102. doi:10.1136/bmj.309.6947.102 Link ↩
  4. Grimes DA, Schulz KF. Uses and abuses of screening tests. Lancet. 2002;359(9309):881-884. doi:10.1016/S0140-6736(02)07948-5 Link ↩

Test yourself in the Question Bank · Listen to the podcasts