Tutorials › Introduction to Statistics › A Worked Positive-Screening Calculation

Conditional Probability and Bayes’ Rule · Tutorial 341 of 996

A Worked Positive-Screening Calculation

Learn to calculate and interpret the probability of disease after a positive screen by comparing true positives with all positive results.

Beginner 9 min read

What You'll Learn

  • Identify prevalence, sensitivity, specificity, and the false-positive rate in a screening problem.
  • Calculate the probability of a positive result using the true-positive and false-positive paths.
  • Find the probability of disease among people with positive screens.
  • Work the same calculation with probabilities and natural frequencies.
  • Explain why a positive result does not mean the person probably has the disease in every setting.
  • Check that the population and test-performance assumptions fit the calculation.

Why a Positive Screen Needs a Denominator

A positive screening result can be concerning, but it does not by itself tell us how likely disease is. To answer that question, we need to compare people with disease who test positive with everyone who tests positive. The second group includes both people with disease and people without disease whose screens are false positives.

The probability we want is the probability of disease given a positive screen. Its value depends on three quantities: disease prevalence in the population being screened, the test's sensitivity, and its specificity. The calculation is a concrete application of conditional probability and Bayes' rule: the test's accuracy measures alone are not the probability of disease after a positive result.

Definition: Let \(D\) denote the event that a person has the disease, and let \(+\) and \(-\) denote positive and negative screening results. Prevalence is \(P(D)\). Sensitivity is \(P(+\mid D)\), the probability of a positive screen among people with disease. Specificity is \(P(-\mid D^c)\), the probability of a negative screen among people without disease. The false-positive rate is \(P(+\mid D^c)=1-\text{specificity}\). The positive predictive value is \(P(D\mid +)\), the probability of disease among people with positive screens.

A screen has two routes to a positive result. Someone with disease may test positive, which is a true positive. Someone without disease may also test positive, which is a false positive. Therefore, the denominator for the positive predictive value must count both routes. Counting only true positives gives the wrong conditional probability.

The Positive-Screening Formula

Suppose the prevalence, sensitivity, and specificity apply to the population and screening procedure under consideration. The events \(D\) and \(D^c\) divide the population into people with and without disease, so every positive screen belongs to exactly one of those groups. By the law of total probability,

$$ P(+)=P(+\mid D)P(D)+P(+\mid D^c)P(D^c). $$

The first term is the probability that a randomly selected person has disease and tests positive. The second term is the probability that the person does not have disease and tests positive. Since \(P(D^c)=1-P(D)\) and \(P(+\mid D^c)=1-\text{specificity}\), Bayes' rule gives

$$ P(D\mid +)= \frac{P(+\mid D)P(D)} {P(+\mid D)P(D)+P(+\mid D^c)P(D^c)} = \frac{\text{sensitivity}\times\text{prevalence}} {\text{sensitivity}\times\text{prevalence} +(1-\text{specificity})\times(1-\text{prevalence})}. $$

The numerator is the true-positive probability: disease and a positive screen. The denominator is the probability of any positive screen, made up of true positives plus false positives. This shows why sensitivity is not the answer to “What is the probability of disease given a positive screen?” Sensitivity conditions on disease being present; the predictive value conditions on a positive test result.

Assumptions for the calculation: The stated prevalence describes the population to which the result will be applied; sensitivity and specificity describe the test in that population and at the relevant screening threshold; and each person is classified as either having or not having the disease and receives a positive or negative result. The formula calculates a probability from those inputs. If the inputs are estimates, the result is correspondingly an estimate and does not account for uncertainty in those estimates.

Worked Calculations

The examples below are hypothetical. Their numbers illustrate the calculation and are not estimates for any real disease or screening program.

Worked Example: A Rare Disease and a Positive Screen

In a hypothetical population, disease prevalence is 1%, a screening test has 90% sensitivity, and specificity is 95%. Find the probability that a person has the disease given a positive result.

First, the false-positive rate is \(1-0.95=0.05\), or 5%. The true-positive path has probability

$$ P(+\mid D)P(D)=0.90(0.01)=0.009. $$

The false-positive path has probability

$$ P(+\mid D^c)P(D^c)=0.05(0.99)=0.0495. $$

Thus the probability of a positive screen is \(0.009+0.0495=0.0585\). The positive predictive value is

$$ P(D\mid +)=\frac{0.009}{0.0585}=0.1538. $$

Under these hypothetical assumptions, about 15.4% of people with positive screens have the disease. The test detects most cases among people who have the disease, but the disease is uncommon and the false-positive rate applies to a much larger group without disease.

The same calculation can be seen with natural frequencies. Imagine 10,000 people: 100 have disease and 9,900 do not. At 90% sensitivity, 90 of the 100 people with disease test positive. At a 5% false-positive rate, 495 of the 9,900 without disease test positive. There are \(90+495=585\) positive screens, of which 90 are true positives, so \(90/585=0.1538\), or about 15.4%.

Worked Example: Calculating With Higher Prevalence

For a different hypothetical screening setting, suppose prevalence is 4%, sensitivity is 95%, and specificity is 98%. Calculate the probability of disease after a positive result.

The false-positive rate is \(1-0.98=0.02\). The true-positive probability is

$$ 0.95(0.04)=0.038. $$

The false-positive probability is

$$ 0.02(1-0.04)=0.02(0.96)=0.0192. $$

So \(P(+)=0.038+0.0192=0.0572\), and

$$ P(D\mid +)=\frac{0.038}{0.0572}=0.6643. $$

The probability of disease among people with positive screens is about 66.4% under these assumptions. In natural frequencies, out of 10,000 people, 400 have disease and \(0.95(400)=380\) of them test positive. Of the 9,600 without disease, \(0.02(9,600)=192\) test positive. Thus \(380+192=572\) people test positive, and \(380/572=0.6643\). The denominator includes both types of positive result.

Worked Example: A Small False-Positive Rate Still Matters

A hypothetical disease has prevalence 2%. A screen has 90% sensitivity and 99% specificity. What is the probability of disease after a positive screen?

Here the false-positive rate is \(1-0.99=0.01\), or 1%. The true-positive probability is

$$ 0.90(0.02)=0.018. $$

The false-positive probability is

$$ 0.01(0.98)=0.0098. $$

Therefore, the probability of any positive result is \(0.018+0.0098=0.0278\), and

$$ P(D\mid +)=\frac{0.018}{0.0278}=0.6475. $$

The positive predictive value is about 64.7%. To check this with frequencies, consider 10,000 people: 200 have disease, of whom 180 test positive. The other 9,800 do not have disease, and 1% of them, or 98, test positive. Thus \(180+98=278\) people test positive; \(180/278=0.6475\) of them have disease. Even a 1% false-positive rate can contribute substantially when many more people are disease-free than have disease.

Why the Calculation Works

The derivation is short but important because it identifies exactly what belongs in the denominator. A conditional probability is the probability of both events divided by the probability of the event after the vertical bar. Here, the event after the bar is a positive result:

$$ P(D\mid +)=\frac{P(D\cap +)}{P(+)}. $$

By the multiplication rule, the numerator is \(P(D\cap +)=P(+\mid D)P(D)\). For the denominator, split all positive results into those among people with disease and those among people without disease. Those groups do not overlap and together include every positive result:

$$ P(+)=P(D\cap +)+P(D^c\cap +) =P(+\mid D)P(D)+P(+\mid D^c)P(D^c). $$

Substituting these expressions into the conditional-probability definition produces the positive-screening formula. In frequency language, it says the same thing: divide the number of true positives by the number of all positives, not by the total population and not by the number of people who have disease.

Interpreting the Result Carefully

A predictive value is conditional on the result: \(P(D\mid +)\) asks about disease status among people whose screens are positive. By contrast, sensitivity \(P(+\mid D)\) asks about test results among people who have disease. Reversing those conditions changes the question, and the probabilities need not be equal.

Prevalence matters because it changes the relative sizes of the disease and non-disease groups feeding into the positive-result denominator. A low prevalence may mean that even a small false-positive rate produces many false positives. Consequently, a test's sensitivity and specificity do not alone determine its positive predictive value; the prevalence for the relevant population is also needed.

This calculation describes probabilities under the specified inputs. It does not establish a diagnosis for a particular person, and it does not show that a screening result causes disease. In practice, estimated prevalence and test performance may vary across populations and settings. Applying values from a different setting without justification can make the calculated predictive value misleading.

Common Mistake: Using Sensitivity as the Answer

A common error is to say, “The test is 90% sensitive, so a person with a positive result has a 90% chance of disease.” This reverses the conditional probability. Sensitivity is the chance of a positive result among people who have disease; the question asks for the chance of disease among people with positive results.

The correction is to calculate both positive-result routes. Use prevalence and sensitivity to find the true-positive probability, and use the non-disease proportion and false-positive rate to find the false-positive probability. Add those probabilities for the total positive-result denominator, then divide the true-positive probability by that total.

Key takeaway: Probability of disease after a positive screen equals true-positive probability divided by the probability of all positive screens. Always include false positives in the denominator and use prevalence from the population to which the answer applies.

Check Your Understanding

For each question, identify the relevant conditional probability or calculation and explain your reasoning.

  1. A hypothetical screen has sensitivity 80%, specificity 90%, and the disease prevalence is 5%. What is the false-positive rate?
  2. In the setting above, write the true-positive probability and false-positive probability as products of conditional probabilities and prevalence terms.
  3. Why is the probability of disease after a positive screen not generally equal to sensitivity?
  4. Suppose a population has 200 people with disease, of whom 160 screen positive, and 800 people without disease, of whom 40 screen positive. What fraction of all positive screens are true positives?
  5. What population information is needed, in addition to sensitivity and specificity, to calculate a positive predictive value?