Why a Test Result Is Not a Diagnosis
A test result is evidence about disease status, not a direct statement of it. Even a highly sensitive test can produce many positive results among people who do not have a rare disease. To interpret a positive result, we need both the test’s operating characteristics and the disease prevalence in the population being tested.
This tutorial uses Bayes’ theorem to answer two practical questions: given a positive result, what is the probability that the person has the disease? Given a negative result, what is the probability that the person nevertheless has it? The second probability is not the same as the probability of a false negative among people who have the disease.
Sensitivity and specificity condition on the person’s disease status. The quantities often wanted after testing condition on the test result instead:
- Positive predictive value (PPV): \(P(D\mid +)\), the probability of disease given a positive result.
- Negative predictive value (NPV): \(P(D^c\mid -)\), the probability of no disease given a negative result. Its complement, \(P(D\mid -)\), is the probability of disease after a negative result.
These are distinct conditional probabilities. In general, \(P(+\mid D)\) is not equal to \(P(D\mid +)\), and \(P(-\mid D^c)\) is not equal to \(P(D^c\mid -)\). Prevalence is needed to convert from the first kind of probability to the second.
Bayes’ Theorem for Diagnostic Results
Assume the target population is clearly specified, each person has one of the two statuses \(D\) or \(D^c\), and each test result is either \(+\) or \(-\). The given sensitivity, specificity, and prevalence must apply to this population and the test procedure being considered. No assumption about the prevalence in a different population should be substituted without justification.
Writing prevalence as \(\pi=P(D)\), sensitivity as \(s=P(+\mid D)\), and specificity as \(c=P(-\mid D^c)\), the same formulas become
The denominator in each expression is the probability of the test result being conditioned on. For a positive result, it includes true positives and false positives. For a negative result, it includes false negatives and true negatives.
Why the Formula Holds
The events \(D\) and \(D^c\) form a partition: they cannot both occur, and one of them must occur. A positive result can therefore arise either from a person with disease or from a person without disease. The multiplication rule gives the probability of each of those joint outcomes.
By the multiplication rule, \(P(D\cap +)=P(+\mid D)P(D)\).
The two disjoint ways to test positive give \(P(+)=P(+\mid D)P(D)+P(+\mid D^c)P(D^c)\).
By the definition of conditional probability, \(P(D\mid +)=P(D\cap +)/P(+)\). Substituting the two expressions above gives the positive-result formula.
For a negative result, the same argument uses \(P(D\cap -)=P(-\mid D)P(D)\) and \(P(-)=P(-\mid D)P(D)+P(-\mid D^c)P(D^c)\). This derivation shows why prevalence cannot be omitted: it determines how much probability comes from each disease-status group before the test result is observed.
Worked Example: A Positive Result for a Rare Condition
Hypothetical scenario. A screening program tests a population in which disease prevalence is \(0.02\). The test has sensitivity \(0.95\) and specificity \(0.90\). Find the probability of disease after a positive result and after a negative result. Give probabilities to four decimal places.
Method. Calculate the joint probabilities for each disease-status and test-result combination, then divide by the probability of the observed result.
The probability of disease is \(0.02\), so the probability of no disease is \(1-0.02=0.98\). Among people with disease, the positive probability is \(0.95\), and the negative probability is \(1-0.95=0.05\). Among people without disease, the negative probability is \(0.90\), and the positive probability is \(1-0.90=0.10\).
The joint probability of disease and a positive result is
The joint probability of no disease and a positive result is
Thus \(P(+)=0.019+0.098=0.117\), and
For a negative result, the disease-and-negative joint probability is \(0.02(0.05)=0.001\), while the no-disease-and-negative joint probability is \(0.98(0.90)=0.882\). Therefore \(P(-)=0.001+0.882=0.883\), and
Check. The result probabilities add to \(0.117+0.883=1\). The posterior probabilities are also consistent with the joint probabilities: the positive-result disease probability is \(0.019/0.117\), not the sensitivity \(0.95\). The common mistake avoided here is treating sensitivity as the probability of disease after a positive result.
Using Natural Frequencies to Check the Calculation
A frequency interpretation can make the denominator easier to understand. If prevalence and test rates are percentages, imagine applying the test to a convenient number of people that makes the arithmetic manageable. For example, with prevalence \(0.04\), a hypothetical group of \(10{,}000\) contains \(400\) people with disease and \(9{,}600\) without disease. The expected counts in each result group are found by applying sensitivity and specificity within the appropriate disease-status group.
Worked Example: Separating Sensitivity from Positive Predictive Value
Hypothetical scenario. A diagnostic test is used in a population with disease prevalence \(0.04\). Its sensitivity is \(0.90\) and its specificity is \(0.98\). Find the PPV and the probability of disease after a negative result. Use a group of \(10{,}000\) to show the calculation, and report probabilities to four decimal places.
There are \(10{,}000(0.04)=400\) people with disease and \(10{,}000-400=9{,}600\) without disease. Of the \(400\) with disease, \(400(0.90)=360\) test positive and \(400(0.10)=40\) test negative. Of the \(9{,}600\) without disease, \(9{,}600(0.02)=192\) test positive because the false-positive rate is \(1-0.98=0.02\); \(9{,}600(0.98)=9{,}408\) test negative.
There are \(360+192=552\) positive results. Consequently,
There are \(40+9{,}408=9{,}448\) negative results, of which \(40\) are from people with disease. Hence
Check. The number with disease after testing, \(360+40=400\), equals the original number with disease. The number without disease, \(192+9{,}408=9{,}600\), also matches its starting group. Sensitivity is \(360/400=0.90\), whereas PPV is \(360/552\approx0.6522\); their different denominators explain why they are not interchangeable.
Both Results and Their Denominators
A negative result does not make the probability of disease zero unless the false-negative rate is zero. The probability of disease after a negative result depends on both the false-negative contribution and the true-negative contribution to all negative tests. Similarly, the NPV is obtained by using the true-negative joint probability as the numerator.
Worked Example: Calculating Both Predictive Values
Hypothetical scenario. A clinic considers a test for a condition with prevalence \(0.15\). Sensitivity is \(0.80\), and specificity is \(0.95\). Find the probability of disease after a positive result, the NPV, and the probability of disease after a negative result. Report probabilities to four decimal places.
The probability of no disease is \(1-0.15=0.85\). The joint probability of disease and a positive result is
The false-positive rate is \(1-0.95=0.05\), so the joint probability of no disease and a positive result is \(0.85(0.05)=0.0425\). Thus \(P(+)=0.12+0.0425=0.1625\), giving
For negative results, the false-negative rate is \(1-0.80=0.20\), so \(P(D\cap -)=0.15(0.20)=0.03\). The joint probability of no disease and a negative result is \(0.85(0.95)=0.8075\). Therefore \(P(-)=0.03+0.8075=0.8375\), and
The NPV uses the no-disease part of the negative group:
Check. The two disease probabilities after positive and negative results are complements only when conditioning on the same result. Here the checks are \(P(D\mid +)+P(D^c\mid +)=1\), and \(0.0358+0.9642=1.0000\) after rounding for the negative result.
Common Exam Traps and Interpretation
The most common error is reversing the condition: using \(P(+\mid D)\) as though it were \(P(D\mid +)\). A second is using specificity in the false-positive part of the positive-result denominator. Specificity is \(P(-\mid D^c)\); the probability needed for false positives is its complement, \(1-\text{specificity}\).
A useful audit is to write the four joint probabilities before computing a posterior:
They must sum to one. The positive-result probability is the sum of the two positive cells, and the negative-result probability is the sum of the two negative cells. This check catches both a wrong complement and a denominator that leaves out one source of results.
Prevalence matters especially when disease is uncommon. Even a small false-positive rate can yield a substantial number of positive results from the much larger group without disease. A high sensitivity or specificity alone therefore does not determine the probability that a particular person has disease after testing.
The calculations are aligned with the SOA VEE Mathematical Statistics syllabus. In practice, predictive values are meaningful only for the population to which the prevalence and test characteristics apply. If testing is done in a subgroup with a different prevalence, the same sensitivity and specificity can produce different predictive values. A predictive value should therefore be reported with its population context, rather than treated as an unchanging property of the test.
Check Your Understanding
For each hypothetical setting, calculate the requested conditional probability. Round each probability to four decimal places.
- A screening test is used where prevalence is \(0.01\), sensitivity is \(0.99\), and specificity is \(0.95\). Find \(P(D\mid +)\). (Answer: \(0.1667\))
- A test has prevalence \(0.12\), sensitivity \(0.85\), and specificity \(0.90\). Find the probability of disease after a negative result. (Answer: \(0.0222\))
- A laboratory test has prevalence \(0.03\), sensitivity \(0.80\), and specificity \(0.97\). Find the probability of disease after a positive result. (Answer: \(0.4520\))
- For a condition with prevalence \(0.25\), a test has sensitivity \(0.92\) and specificity \(0.88\). Find both \(P(D\mid +)\) and \(P(D\mid -)\). (Answer: \(0.7188\) and \(0.0294\))
- A test is applied in a population with prevalence \(0.005\), sensitivity \(0.99\), and specificity \(0.995\). Find the probability of disease after a positive result. (Answer: \(0.4987\))