AdvancedIndependently reviewed, not yet spot-checked by a human

Predictive values and prevalence

PPV and NPV answer the question patients actually ask, but they are not properties of the test — the same test can have PPVs two orders of magnitude apart at different prevalences. This page opens up the Bayes formula, tells the same story again in whole people, shows why most positives in a rare-disease screening programme are false positives, and then handles a qualification textbooks rarely state: "sensitivity and specificity do not vary with prevalence" is a statement about the arithmetic, not about the world.

Nobody in clinic asks about sensitivity

No patient has ever asked what a test’s sensitivity is. What they ask is: my result came back positive, so do I have this or not?

The answer to that question is the positive predictive value (PPV), and it is a completely different quantity from sensitivity:

Sensitivity=P(test positivedisease),PPV=P(diseasetest positive)\text{Sensitivity} = P(\text{test positive} \mid \text{disease}), \qquad \text{PPV} = P(\text{disease} \mid \text{test positive})

The two conditional probabilities have the condition pointing the opposite way. Treating them as the same thing is the most common statistical error in clinical practice, and also the most expensive one — expensive because it turns a positive screening result for a rare disease into a diagnosis, and hangs a chain of invasive investigations off it.

Bayes joins the two together

Straight from the 2×2 table:

PPV=sens×prevsens×prev+(1spec)×(1prev)\text{PPV} = \frac{\text{sens} \times \text{prev}}{\text{sens} \times \text{prev} + (1 - \text{spec}) \times (1 - \text{prev})} NPV=spec×(1prev)spec×(1prev)+(1sens)×prev\text{NPV} = \frac{\text{spec} \times (1 - \text{prev})}{\text{spec} \times (1 - \text{prev}) + (1 - \text{sens}) \times \text{prev}}

The numerator is the share of the population that is truly positive; the denominator is the share that tests positive at all. Prevalence appears on both sides of the formula, and it appears nowhere inside sensitivity or specificity. That is the entire content of “predictive values are not properties of the test” — it is not a philosophical point, it is this equation.

One test, seven prevalences

Keeping the setup from the 2×2 table page: S100β from pROC::aSAH, cut-off 0.20 µg/L, sensitivity 63.4% and specificity 80.6%. Nail those two down and move only the prevalence:

Prevalence (pre-test probability)PPVShare of positives that are falseNPVShare of negatives that are false
0.1%0.3%99.7%99.95%0.05%
0.5%1.6%98.4%99.77%0.23%
1%3.2%96.8%99.54%0.46%
5%14.7%85.3%97.67%2.33%
10%26.6%73.4%95.20%4.80%
This study cohort65.0%35.0%79.45%20.55%
50%76.5%23.5%68.77%31.23%
Curve plot. The horizontal axis is prevalence on a log scale and the vertical axis is predictive value; the PPV curve rises from lower left to upper right while the NPV curve falls from upper left to lower right. A further dashed curve shows the PPV of a test with 99% sensitivity and 99% specificity, and a vertical dashed line marks the prevalence of this study cohort.
Sensitivity and specificity are held fixed throughout; only prevalence moves. The PPV and NPV curves are the continuous version of the table above. The dashed curve is a near-perfect test: it has shifted bodily to the left, but its shape has not changed.Plotting script figures/scripts/B4-02-ppv-npv.R

At a prevalence of 0.1% the PPV is 0.3%; at 50% it is 76.5% — one test, one sensitivity, one specificity, and a PPV differing by more than two orders of magnitude.

One number worth carrying around is a test’s break-even prevalence: the pre-test probability at which PPV reaches one half, so that a positive report leaves disease and no disease evenly matched. For this test it is 23.5%. Below that prevalence, the most likely explanation of a positive report is still that the patient does not have the disease.

Say it in whole people

Probabilities deceive the eye; counts do not. Send 10000 people through this test at a prevalence of 0.1%:

Disease present (10 people)Disease absent (9990 people)Total
Test positive6.31942.51948.8
Test negative3.78047.58051.2

Of the 1948.8 positive reports, only about 6.3 belong to someone who really has the disease. Every other one is a false positive, giving a PPV of 0.33%.

The reason is not that the test is bad. It is that the two denominators differ by so much: there are 9990 people without the disease, so even a misclassification rate of only 19.4% produces 1942.5 false positives, while there are only 10 people with the disease in total, so catching every last one of them still yields no more than 10 true positives. The number of false positives is set by how many people do not have the disease; the number of true positives is set by how many do — and in a rare disease those two counts differ by several orders of magnitude.

Swapping in a near-perfect test does not rescue it

The intuitive next move is “then use a better test”. Push both sensitivity and specificity up to 99%, send the same 10000 people through, at the same prevalence of 0.1%:

PrevalencePPV (the S100β test)PPV (a 99% / 99% test)
0.1%0.3%9.0%
0.5%1.6%33.2%
1%3.2%50.0%
5%14.7%83.9%
10%26.6%91.7%
This study cohort65.0%98.3%
50%76.5%99.0%

At a prevalence of 0.1%, this near-perfect test produces 9.9 true positives and 99.9 false positives, for a PPV of 9.0%. Still only one positive in ten is real. Its break-even prevalence is 1.0% — far better than the original 23.5%, and still far above the prevalence of this disease.

The other face of NPV: do not let a high one reassure you

In the table above, the NPV column looks like good news at low prevalence: at a prevalence of 0.1% the NPV is 99.95%. It carries almost no information. In a population with a prevalence of 0.1%, skipping the test entirely and telling everyone “you do not have it” would already be right 99.9% of the time. The test moves that from 99.9% to 99.95% — a very small change.

The right tool for judging what a test result actually changed is to put the pre-test and post-test probabilities side by side, rather than reading the post-test value on its own. There is a quantity built for exactly that: the likelihood ratio.

A qualification textbooks rarely state

The tidiest way to end here would be: “so sensitivity and specificity are properties of the test, PPV and NPV are properties of the population, and that sentence is all you need.”

That sentence is true of the arithmetic, and is an assumption to be checked about the real world. Split this same dataset by WFNS grade — neurological severity on admission — into two strata. Their prevalences differ a great deal, and so, it turns out, do their sensitivities and specificities:

StratumnDiseased nNon-diseased nPrevalenceSensitivity (95% CI)Specificity (95% CI)
WFNS 1-271145719.7%28.6% (11.7–54.6)94.7% (85.6–98.2)
WFNS 3-542271564.3%81.5% (63.3–91.8)26.7% (10.9–52.0)

In the more severely affected stratum the prevalence is 64.3% and the sensitivity is 81.5%; in the less severely affected stratum the prevalence is 19.7% and the sensitivity is only 28.6%. The two 95% confidence intervals for sensitivity do not overlap at all, so the gap is unlikely to be sampling variation alone.

Run it yourself

library(pROC)
data(aSAH, package = "pROC")

pos <- aSAH$s100b >= 0.20
dis <- aSAH$outcome == "Poor"
sens <- sum(pos & dis) / sum(dis)
spec <- sum(!pos & !dis) / sum(!dis)

ppv <- function(prev, sens, spec)
  sens * prev / (sens * prev + (1 - spec) * (1 - prev))
npv <- function(prev, sens, spec)
  spec * (1 - prev) / (spec * (1 - prev) + (1 - sens) * prev)

prev <- c(0.001, 0.005, 0.01, 0.05, 0.10, mean(dis), 0.50)
round(data.frame(prev,
                 PPV = ppv(prev, sens, spec),
                 NPV = npv(prev, sens, spec)), 4)

# Break-even prevalence: the pre-test probability at which PPV reaches one half
(1 - spec) / (sens + 1 - spec)

# The same thing said in whole people
N <- 10000; p <- 0.001
c(TP = N * p * sens, FN = N * p * (1 - sens),
  FP = N * (1 - p) * (1 - spec), TN = N * (1 - p) * spec)

# Exported for the Python block below
write.csv(aSAH, "aSAH.csv", row.names = FALSE)

Verified with R 4.6.0 and pROC 1.19.0.1. This section uses arithmetic only; no extra packages are needed.

Common misuses

MisuseWhy it is wrong
Reading sensitivity as “the probability that a positive means disease”The condition is the wrong way round; that quantity is PPV, and it also needs the prevalence
Quoting a paper’s PPV and applying it to your own patientsPPV is tied to that study’s prevalence, and does not survive a change of population
Computing PPV from case-control sampled dataThe numbers of cases and controls were chosen by the investigator, so the PPV means nothing
Using a high NPV to argue the test “rules disease out well”At low prevalence you get a high NPV without testing anyone; look at LR− instead
Believing “an accurate enough test solves rare-disease screening”The number of false positives is set by the number of non-diseased people, however high the sensitivity
Treating a positive screening result as a diagnosisScreening exists to raise the post-test probability enough to justify a confirmatory test; it is not the end point
Evaluating a screening programme only by how many cases it foundThe invasive follow-up and overdiagnosis that false positives cause belong in the cost column
Assuming a published sensitivity transfers unconditionally to another settingThe spectrum effect: changing population changes case mix, and sensitivity moves with it
Judging a test for a rare disease by overall accuracyCalling everyone negative already gives a high accuracy
Picking a cut-off from the same data and then reporting its PPVOptimistic bias; see choosing a cut-off and comparing two ROC curves

Reproducing every number on this page

/opt/homebrew/bin/Rscript figures/scripts/B4-02-ppv-npv.R

Read the figure

The answer comes from the same statistical output that produced this page's figures, not from a number typed in beside them.

The same test, with the same sensitivity of 0.634 and specificity of 0.806, is applied to two populations, one with a prevalence of 0.1% and one with a prevalence of 50%. What happens to PPV?

Show the answer and why

Correct answer: At a prevalence of 0.1% the PPV is only 0.0033, and it jumps to roughly three quarters at 50% - PPV is tied to prevalence

Prevalence appears in both the numerator and the denominator of the Bayes expression, while the two inputs the test contributes, a sensitivity of 0.634 and a specificity of 0.806, contain no prevalence at all. That is the whole content of the sentence 'predictive values are not properties of the test'. At a prevalence of 0.1% the PPV is 0.0033 and at one half it is 0.7653, two orders of magnitude apart for one and the same test. 0.6500 is the PPV measured in this study cohort and holds only there; carrying it to another population means treating the investigators' sampling ratio as this patient's pre-test probability.

Ten thousand people with a disease prevalence of 0.1% are tested (sensitivity 0.634, specificity 0.806). The table shows about 6.3 true positives and 1942.5 false positives. Why are there so many false positives?

Show the answer and why

Correct answer: Because 9990.0 people do not have the disease, and even if fewer than two in ten are misclassified that is far more people than the entire diseased group

The number of false positives is the number of non-diseased people times the false-positive rate: 9990.0 people without the disease, a specificity of 0.806 meaning almost two in ten are misclassified, and 1942.5 false positives follow. Only 10.0 people have the disease, so catching all of them would yield ten true positives and the test catches 6.3. Patients who are missed are false negatives and sit in the negative cell; they never become false positives, and confusing the two error cells is the mistake here. 8047.5 is the count of true negatives, whose size has no bearing on the absolute number of false positives. This is the structure of rare-disease screening: the two denominators differ by orders of magnitude.

Raise both sensitivity and specificity to 99% and run the same population at a prevalence of 0.1% again. Can a positive report now be treated as a diagnosis?

Show the answer and why

Correct answer: No. The PPV only rises to 0.0902, so still only one positive report in ten is real

A better test shrinks the false positives but does nothing to the ratio of the two denominators, so the PPV only reaches 0.0902 and nine positives in ten are still false. The break-even prevalence of 0.0100 is the pre-test probability at which PPV reaches one half, an order of magnitude above the prevalence of this population - below break-even, the most likely explanation of a positive report is still no disease. 0.9900 is merely this test's PPV in a cohort split evenly between cases and non-cases, not an intrinsic property of it. The most effective lever on PPV is usually not a better test but a narrower population with a higher pre-test probability.

In a population with a prevalence of 0.1% this test has an NPV of 99.95%. Does that number show it is good at ruling the disease out?

Show the answer and why

Correct answer: It does not. The share of negative reports that are false is 0.0005, and in this population telling everyone they are disease-free without testing at all would also be wrong only about one time in a thousand

NPV is driven mostly by how many people in the population were disease-free to begin with. At a prevalence of 0.1%, telling everybody they are disease-free without testing at all is already wrong only about one time in a thousand; the test pushes the false-omission share of negative reports to 0.0005, which is a very small change. 0.9995 is an absolute post-test value, and reading it alone turns 'this population was healthy anyway' into 'this test is powerful'. 0.6877 really is the same test's NPV in an evenly split cohort, but that is not luck - it is prevalence doing its work in the formula. To judge what a test result changed you compare pre-test and post-test side by side, and the quantity for that is the likelihood ratio.

Splitting the same patients by WFNS grade gives a sensitivity of 0.286 in one stratum and 0.815 in the other. Does that contradict 'sensitivity does not vary with prevalence'?

Show the answer and why

Correct answer: No. The two strata are two different groups of patients: the sicker stratum has the higher sensitivity and its specificity falls to 0.267, both measures being driven by case mix

The demonstration on the previous page copied the same people as a block without replacing anyone, which is why sensitivity did not budge: that is a property of the arithmetic. Here the patients themselves are different. The higher-WFNS stratum has more brain injury and higher marker concentrations, so the same cut-off catches them and sensitivity rises to 0.815; the same mechanism lifts the values of the good-outcome patients in that stratum, who then cross the cut-off more often as false positives, and specificity falls to 0.267. Both measures move with case mix, which is the spectrum effect. 0.546 is the upper bound in the milder stratum, and the lower bound in the sicker one sits above it, so the intervals do not in fact overlap. 0.643 is the prevalence of the sicker stratum, which changes alongside sensitivity without being the reason sensitivity changed.

This test has a break-even prevalence of 23.5%. How should that number be used in clinic?

Show the answer and why

Correct answer: Below a pre-test probability of 0.2347, the most likely explanation of a positive report is still that the patient is disease-free

The break-even prevalence is the pre-test probability at which PPV reaches one half: below 0.2347 a positive report still leaves the odds tilted towards no disease. That does not make a positive report meaningless - it did raise the probability, just not past one half, which is why a confirmatory test usually follows. 0.3500 is the share of positive reports in this study cohort that are false, not a threshold. 0.0100 is the break-even prevalence of the near-perfect test, and using it here charges this test with a standard it cannot meet.

Watch next

Sensitivity, Specificity, PPV, NPV
ENDirty Medicine· 11 minAll four measures in one pass, with the weight put on how PPV and NPV are dragged around by prevalence — which is exactly this page's third section.
Sensitivity and Specificity Explained Clearly (Biostatistics)
ENMedCram· 12 minTies the four measures together inside a clinical scenario. Good for rebuilding intuition after working through the algebra in section two.
醫學統計 EP17 敏感度、特異度與預測值
繁中EDMAN MURMURS· 9 minIn Mandarin, and the place to look if you also need the Chinese terms for the predictive values.
實證醫學-診斷與篩檢
繁中rookie days 菜鳥日子· 31 minIn Mandarin, and clearer than most textbooks on how screening differs from diagnosis — the subject of this page's fifth section.
Principles of Epidemiology 10. Diagnosis, Tests, and Screening
繁中臺大開放式課程 NTU OCW· 60 minA full lecture in Mandarin from National Taiwan University's open courseware, covering the epidemiology of screening programmes including lead time and length bias.

Sources and licences

This page is original writing

Report a content problem

The statistics on this site are written by AI and reviewed by AI; a human only spot-checks. What you can see may be what we cannot.

The more specific, the more fixable — e.g. which sentence disagrees with which textbook or paper.

Needed only if you want a reply; reports without it are still read.

Sent along with your report

These are attached automatically. You can drop any of them.