ENFR

PPV / NPV: 10 worked exercises

Ten problems on predictive values, from a first 2×2 table to the traps that catch clinicians. Each one states the problem, then folds the full solution away: try it, then open it. The method throughout is the same — build a cohort, split it, read the answer off the table.

The method, once

Do not substitute into Bayes' theorem under time pressure. Take a round cohort, split it by prevalence, apply the sensitivity to the diseased half and one minus the specificity to the healthy half. You now have the four cells, and every quantity is a ratio of them. The arithmetic checks itself: the cells must sum to N.

Exercise 1 — the first table

A screening mammogram detects about 90% of cancers (sensitivity) and returns a false positive in about 9% of healthy women (specificity 91%). In the screened age group, about 1 woman in 100 has breast cancer. Take 1,000 women. Build the 2×2 table and compute the PPV and the NPV.

Show the solution
• Split 1,000 by prevalence: 10 with cancer, 990 without.
• Of the 10 with cancer, the test finds 90%: TP = 9, FN = 1.
• Of the 990 without, 9% are falsely flagged: FP = 89, TN = 901.
• Check: 9 + 1 + 89 + 901 = 1,000 ✓
• Positives: 9 + 89 = 98, of whom 9 are ill.
PPV = 9 / 98 = 9.2%   NPV = 901 / 902 = 99.9%

A positive screening mammogram is wrong nine times out of ten. This is not a broken test — it is why a positive screen leads to a biopsy and not to a diagnosis.

Exercise 2 — read the table backwards

A study tests 500 patients. 80 have the disease; the test is positive in 72 of them. Of the 420 without the disease, the test is positive in 42. Compute the sensitivity, the specificity, the PPV and the NPV.

Show the solution
• TP = 72, FN = 80 − 72 = 8, FP = 42, TN = 420 − 42 = 378.
Se = 72 / 80 = 90%   (down the diseased column)
Sp = 378 / 420 = 90%   (down the healthy column)
PPV = 72 / (72 + 42) = 63.2%   (across the positive row)
NPV = 378 / (378 + 8) = 97.9%   (across the negative row)

Sensitivity and specificity divide by the columns. Predictive values divide by the rows. Same four cells, different denominator — that is the whole distinction.

Exercise 3 — the same test, two clinics

A test has sensitivity 90% and specificity 95%. Compute the PPV (a) when screening a population where the disease affects 1 in 1,000, and (b) in a specialist clinic where 30% of referred patients turn out to have it.

Show the solution
• (a) π = 0.1% : PPV = 1.8%
• (b) π = 30% : PPV = 88.5%
• Sensitivity and specificity are identical in both. Only the population changed.

This is the single most consequential fact in the topic. A positive result does not have one meaning. It has a meaning per population, and the referral filter is what changes it.

Exercise 4 — likelihood ratios and odds

A test has sensitivity 80% and specificity 90%. (a) Compute LR+ and LR−. (b) A patient has a pre-test probability of 20%. The test comes back positive. Use the odds form to find the post-test probability.

Show the solution
• LR+ = Se / (1 − Sp) = 0.80 / 0.10 = 8
• LR− = (1 − Se) / Sp = 0.20 / 0.90 = 0.22
• Pre-test odds = 0.20 / 0.80 = 0.25
• Post-test odds = 0.25 × 8 = 2.00
• Back to a probability: 2.00 / (1 + 2.00) = 66.7%

The likelihood ratio contains no prevalence, which is why it is the part you may take from a published study and apply to the patient in front of you.

Exercise 5 — work backwards to the prevalence

A laboratory reports that, in its own patient population, a test with sensitivity 95% and specificity 90% has a PPV of 32%. What is the prevalence of the disease among the patients it tests?

Show the solution
• Use the odds form in reverse. LR+ = 0.95 / 0.10 = 9.5.
• PPV 32% : post-test odds = 0.32 / 0.68 = 0.47.
• Pre-test odds = post-test odds / LR+ = 0.47 / 9.5 = 0.0495.
• π = odds / (1 + odds) = 4.7%
• Check by substitution: PPV(Se 95%, Sp 90%, π 4.7%) = 32.0% ✓

The odds form runs in both directions. This is the calculation that tells you what population a published PPV was actually measured in.

Exercise 6 — the 99% test

A disease affects 1 person in 1,000. A test is 99% sensitive and 99% specific. A patient tests positive. What is the probability that they have the disease? Answer before computing, then compute.

Show the solution
• Cohort of 100,000: 100 ill, 99,900 healthy.
• TP = 99, FN = 1, FP = 999, TN = 98,901.
• Positives: 99 + 999 = 1,098.
PPV = 99 / 1,098 = 9.0%

Nine times out of ten the positive is wrong, from a test that is correct 99% of the time in both directions. The 1% of 99,900 healthy people it mislabels outnumber the 100 ill people who exist.

Exercise 7 — the NPV illusion

A test has sensitivity 50% and specificity 90%. It is used to screen a population where the disease affects 0.2%. (a) Compute the NPV. (b) Compute the NPV of a “test” that simply reports “negative” for everyone. Compare.

Show the solution
• (a) NPV = 99.89%
• (b) The always-negative rule is right about everyone who is healthy, so its NPV = 1 − π = 99.80%
• The real test, which misses half of all cases, beats the rock by 0.09 points.

A high NPV in a low-prevalence setting means almost nothing: it is a fact about the rarity of the disease, not about the test. Judge rule-out performance by LR− or by sensitivity, neither of which contains the prevalence.

Exercise 8 — the case–control trap

A manufacturer validates a test on 700 known-positive archived specimens and 10,000 blood-donor specimens. The test is reactive on 699 of the positives and on 20 of the donors. The insert reports a PPV of 97%. (a) Verify that figure from the table. (b) Explain why it is meaningless. (c) Compute the PPV that applies to screening a population with a prevalence of 0.1%.

Show the solution
• (a) PPV = 699 / (699 + 20) = 699 / 719 = 97.2%. The insert is arithmetically correct.
• (b) The study's own prevalence is 700 / 10,700 = 6.5%. Nobody measured that. Somebody chose to buy 700 positive specimens rather than 300 or 2,000. The row totals encode a purchasing decision, not a population.
• (c) Extract what is transportable: Se = 699/700 = 99.86%, Sp = 9,980/10,000 = 99.80%. Substitute with π = 0.1%: PPV = 33.3%.
• Two thirds of positives in real screening are false — from a test whose insert is entirely truthful.

You may never read a predictive value off a case–control table. Extract the sensitivity and the specificity, then compute the PPV yourself with the prevalence of the population you actually intend to test.

Exercise 9 — a bad PPV on a good test

D-dimer for suspected pulmonary embolism: sensitivity 97%, specificity 40%. A patient has a Wells-based pre-test probability of 15%. (a) Compute the PPV if the test is positive. (b) Compute the residual probability of PE if the test is negative. (c) Is this a bad test?

Show the solution
• (a) PPV = 22.2% — which looks indefensible.
• (b) LR− = 0.03 / 0.40 = 0.075. Pre-test odds = 0.15/0.85 = 0.176. Post-test odds = 0.176 × 0.075 = 0.013. Residual probability = 1.3%.
• (c) No — it is an excellent test, used correctly. Its job is not to rule PE in. Its job is to rule PE out, and it drops a 15% probability below the threshold at which imaging and anticoagulation are justified.

Judge a test against the decision it is meant to support, not against its PPV. A test built to rule out is judged on LR−.

Exercise 10 — why screening runs in two stages

A screening programme uses a sensitive first test (Se 99%, Sp 80%) followed, on positives only, by a specific confirmatory test (Se 95%, Sp 99.5%). The disease affects 0.5% of the screened population. Take 100,000 people. (a) What is the PPV after the first test? (b) What is the PPV after the second?

Show the solution
• Stage 1: 500 ill, 99,500 healthy : TP = 495, FP = 19,900.
• (a) PPV after stage 1 = 495 / 20,395 = 2.4% — poor, as expected of a deliberately over-sensitive screen.
• But look what it did: among the 20,395 people sent to stage 2, the prevalence is now 2.4%, not 0.5%. The first stage enriched the population forty-fold.
• (b) Apply the confirmatory test at π = 2.4%: PPV = 83%.

This is the whole architecture of screening, and it is a consequence of the arithmetic rather than a policy choice. The first stage exists to raise the prevalence for the second.

Every formula used here, with the derivations and the sources:

PPV / NPV cheat sheet Or move the sliders yourself: PPV / NPV playground

Stat Exam Pro drills exactly these problems as timed exam questions with worked answers, in English and French.

Get it on iPhone