Tutorials › Introduction to Statistics › Comparing Screening Tests at Different Prevalences

Conditional Probability and Bayes’ Rule · Tutorial 343 of 996

Comparing Screening Tests at Different Prevalences

Learn why the same screening test can have different positive predictive values in populations with different disease prevalence.

Beginner 9 min read

What You'll Learn

  • Define positive predictive value and prevalence in a screening setting.
  • Calculate positive predictive value from prevalence, sensitivity, and specificity.
  • Compare the same test’s predictive value across populations using natural frequencies.
  • Explain why a higher prevalence raises positive predictive value when test characteristics are fixed.
  • Identify when a comparison based on constant sensitivity and specificity may not apply.

Why the Same Positive Result Can Mean Different Things

A screening test can have the same sensitivity and specificity in two populations and still have different positive predictive values. The reason is that the populations may have different disease prevalences. When disease is uncommon, even a modest false-positive rate can produce many positive results among people without the disease. When disease is more common, a larger share of positive results may come from people who have it.

The question here is not whether the test itself changed. We will compare the same test under the explicit assumption that its sensitivity and specificity are constant across the populations. We will see how prevalence alone affects the probability that a person with a positive result has the disease.

Definition: Let \(D\) mean that a person has the disease and \(T+\) mean that the screening test is positive. The prevalence \(p=P(D)\) is the proportion of the population that has the disease before testing. The positive predictive value (PPV) is \(P(D\mid T+)\), the probability that a person has the disease given a positive test. Sensitivity is \(P(T+\mid D)\), and specificity is \(P(T-\mid D^c)\), where \(T-\) is a negative result and \(D^c\) means no disease.

Sensitivity describes positive results among people who have the disease; specificity describes negative results among people who do not. PPV reverses the conditioning: it describes disease status among people with a positive result. These quantities answer different questions, so a test’s sensitivity or specificity cannot, by itself, be read as the probability that a positive result is correct.

Calculating PPV From Prevalence

Write sensitivity as \(Se=P(T+\mid D)\) and specificity as \(Sp=P(T-\mid D^c)\). The false-positive rate is \(P(T+\mid D^c)=1-Sp\). A positive result can occur in either of two disjoint groups: a person has the disease and tests positive, or a person does not have the disease and tests positive. The law of total probability therefore gives \(P(T+)=Se\,p+(1-Sp)(1-p)\). Bayes’ rule then gives:

$$ \operatorname{PPV}=P(D\mid T+) =\frac{Se\,p}{Se\,p+(1-Sp)(1-p)} $$

The numerator is the proportion of the population who both have the disease and test positive. The denominator is the proportion who test positive, including both true positives and false positives. The formula assumes the stated sensitivity and specificity apply in the population being considered and that the test result has the two categories \(T+\) and \(T-\). For a meaningful PPV calculation, the denominator must be greater than zero.

Worked Example: A Rare Disease and a More Common Disease

Suppose the same hypothetical screening test has sensitivity 90% and specificity 95% in two populations. In Population A, prevalence is 2%; in Population B, it is 20%. Compare PPV using a hypothetical group of 10,000 people in each population.

Population A. At 2% prevalence, 200 of the 10,000 people have the disease and 9,800 do not. With 90% sensitivity, the expected number of true positives is \(0.90(200)=180\). The false-positive rate is \(1-0.95=0.05\), so the expected number of false positives is \(0.05(9{,}800)=490\). Thus, there are 670 positive results:

$$ \operatorname{PPV}_A =\frac{180}{180+490} =\frac{180}{670} \approx 0.2687 $$

About 26.9% of positive results in Population A are expected to be true positives under these assumptions.

Population B. At 20% prevalence, 2,000 of the 10,000 people have the disease and 8,000 do not. The expected number of true positives is \(0.90(2{,}000)=1{,}800\), and the expected number of false positives is \(0.05(8{,}000)=400\). Therefore:

$$ \operatorname{PPV}_B =\frac{1{,}800}{1{,}800+400} =\frac{1{,}800}{2{,}200} \approx 0.8182 $$

About 81.8% of positive results in Population B are expected to be true positives. Sensitivity and specificity were unchanged, but prevalence was higher, so true positives made up a larger share of all positive results.

Why PPV Rises With Prevalence

The direction of the comparison is not limited to the particular numbers in the example. For fixed sensitivity and specificity, PPV increases as prevalence increases, provided the test has positive sensitivity and a nonzero false-positive rate. One way to verify this is to let \(f=1-Sp\), the false-positive rate, and write the formula as a function of prevalence:

$$ q(p)=\frac{Se\,p}{Se\,p+f(1-p)} =\frac{Se\,p}{f+(Se-f)p} $$

For \(0<p<1\), differentiate with respect to \(p\). Applying the quotient rule, the derivative is:

$$ q'(p) =\frac{Se\,[f+(Se-f)p]-Se\,p(Se-f)} {\left[f+(Se-f)p\right]^2} =\frac{Se\,f}{\left[f+(Se-f)p\right]^2} $$

If \(Se>0\) and \(f>0\), the numerator is positive and the denominator is positive. Therefore \(q'(p)>0\): increasing prevalence increases PPV when sensitivity and specificity are held fixed. The conclusion is also intuitive from the count of positive results. As prevalence rises, the population contains more people who can contribute true positives, while a smaller share of the population is disease-free and can contribute false positives.

There are boundary cases worth recognizing. If specificity is 100%, then \(f=0\); when there are true positives, every positive result is a true positive, so PPV is 1. If sensitivity is zero, no person with the disease tests positive, and PPV is zero whenever positive results occur among people without the disease. These special cases do not reverse the general relationship.

Worked Example: Comparing Two Other Prevalences

A hypothetical test has sensitivity 95% and specificity 90%. Compare its PPV in two populations with prevalences of 5% and 30%, using 10,000 people in each. The same sensitivity and specificity are assumed to apply in both populations.

At 5% prevalence, 500 people have the disease and 9,500 do not. The expected true positives are \(0.95(500)=475\). Since the false-positive rate is \(1-0.90=0.10\), the expected false positives are \(0.10(9{,}500)=950\). Thus:

$$ \operatorname{PPV}_{5\%} =\frac{475}{475+950} =\frac{475}{1{,}425} \approx 0.3333 $$

At 30% prevalence, 3,000 people have the disease and 7,000 do not. There are \(0.95(3{,}000)=2{,}850\) expected true positives and \(0.10(7{,}000)=700\) expected false positives. The PPV is:

$$ \operatorname{PPV}_{30\%} =\frac{2{,}850}{2{,}850+700} =\frac{2{,}850}{3{,}550} \approx 0.8028 $$

The positive predictive value increases from about 33.3% to 80.3%. In the lower-prevalence population, the 950 false positives outnumber the 475 true positives. In the higher-prevalence population, the 2,850 true positives substantially outnumber the 700 false positives.

Finding a Prevalence for a Target PPV

The same relationship can be rearranged to ask what prevalence would be needed to attain a chosen PPV, if test characteristics remain fixed. This is useful for interpreting why a positive result may be more informative in one screening setting than another.

Worked Example: When Would Half of Positive Results Be True Positives?

Suppose a hypothetical test has sensitivity 90% and specificity 95%. Find the prevalence at which its PPV is 50%, assuming those characteristics are constant.

Set the PPV formula equal to 0.50. The false-positive rate is \(1-0.95=0.05\):

$$ 0.50=\frac{0.90p}{0.90p+0.05(1-p)} $$

At a PPV of 0.50, the true-positive and false-positive contributions to positive results must be equal. Equivalently, cross-multiplication gives:

$$ 0.50[0.90p+0.05(1-p)]=0.90p $$

Multiplying both sides by 2 shows that the full positive-result denominator must equal twice the true-positive contribution. Thus the false-positive contribution must equal the true-positive contribution:

$$ 0.05(1-p)=0.90p $$

Solving,

$$ 0.05=0.95p \qquad\Longrightarrow\qquad p=\frac{0.05}{0.95}\approx 0.05263 $$

The prevalence is about 5.26%. At this prevalence, the expected true-positive and false-positive contributions are equal, so half of positive results are expected to be true positives. This is a mathematical threshold under the assumed test characteristics, not a claim that the test should or should not be used at that prevalence.

Interpreting Comparisons Carefully

A prevalence comparison is most useful when it is clear which features are being held constant. The calculations above assume that the same test, threshold for calling a result positive, and definitions of disease and positive result apply in both populations. They also assume that sensitivity and specificity are unchanged. If these conditions do not hold, a change in PPV cannot be attributed to prevalence alone.

In practice, sensitivity and specificity can differ across populations. For example, the mix of disease severity or other characteristics among people with the disease may differ, or test administration may vary. Those differences can affect the conditional probabilities \(P(T+\mid D)\) and \(P(T-\mid D^c)\). A comparison should therefore use sensitivity and specificity appropriate to each population, rather than automatically carrying one population’s test characteristics into another.

Population size alone does not determine PPV. If a population is made larger while prevalence, sensitivity, and specificity stay fixed, the expected numbers of true and false positives both scale with population size, leaving their ratio unchanged. Prevalence matters because it changes the relative sizes of the disease and disease-free groups, not merely the total number of people screened.

Common Mistake

Wrong reasoning: “The test has 90% sensitivity, so 90% of people with a positive result have the disease.” Sensitivity is \(P(T+\mid D)\), not \(P(D\mid T+)\). It starts with people who have the disease and asks how often they test positive.

Correction: To interpret a positive result, calculate \(P(D\mid T+)\) using prevalence, sensitivity, and specificity. The denominator must include both true-positive and false-positive results. If prevalence changes while test characteristics remain fixed, that denominator’s composition changes, and so does PPV.

Key takeaway: For a fixed test with constant sensitivity and specificity, higher disease prevalence leads to higher positive predictive value. Always distinguish the chance of a positive result among people with disease (sensitivity) from the chance of disease among people with a positive result (PPV).

Check Your Understanding

Use the definitions and relationship in this tutorial to answer the following questions.

  1. A test has sensitivity 80% and specificity 90%. What is its false-positive rate?
  2. For the same test, explain why PPV would generally be higher in a population with 15% prevalence than in one with 2% prevalence, assuming sensitivity and specificity remain constant.
  3. In a hypothetical group of 1,000 people, prevalence is 10%, sensitivity is 90%, and specificity is 80%. How many true positives and false positives are expected, and what is the PPV?
  4. In one sentence, distinguish sensitivity from positive predictive value using conditional probabilities.
  5. Name one reason why comparing two populations under an assumption of constant sensitivity and specificity might be inappropriate.