Resources
Conditional probability and the base rate
Suppose a disease affects 1% of a population, and a screening test detects 99% of people who have the disease and correctly clears 95% of those who do not. A person tests positive. The probability that this person actually has the disease is about 17%, not 99%, and the difference comes from conditional probability and the low prevalence of the disease.
Two conditional probabilities
Sensitivity is \(P(\text{positive}\mid\text{disease})\), and the question a patient usually wants answered is \(P(\text{disease}\mid\text{positive})\). These probabilities reverse the condition, so they have different denominators and can have very different values. Confusing them is an inverse-probability error.
Draw the population
Each square is one person in a population of 10,000. Black squares are true positives; gray squares are false positives; the faint field is everyone who tested negative. The readout computes the probability that a positive result is genuine, which is the black squares as a fraction of all shaded squares. At the default settings, gray squares outnumber black ones roughly five to one. Now raise the prevalence and watch the same test become trustworthy: the test never changed, only the population did. This is the base rate doing its quiet work.
The display represents 10,000 people. At 1% prevalence, 100 people have the disease, and with 99% sensitivity, 99 of those people test positive. The remaining 9,900 people do not have the disease, and with 95% specificity, 5% of that group tests positive incorrectly: \(0.05(9900)=495\).
So the positive group contains \(99+495=594\) people, and only 99 actually have the disease. Therefore \(P(\text{disease}\mid\text{positive}) = \tfrac{99}{594} \approx0.167\). The calculation becomes much easier to reason about when the probabilities are converted into counts.
Why prevalence matters
The test is good and the disease is rare, which means the healthy population is much larger than the diseased population. A small false-positive rate applied to a very large group can therefore produce more false positives than a high sensitivity produces true positives.
Raise the prevalence while keeping the test characteristics fixed, and the probability that a positive result is genuine rises sharply. The test did not improve. The population changed. This underlying prevalence is the base rate.
Reading “given”
For a conditional probability \(P(A\mid B)\), the event after the vertical bar is the condition, and it determines the denominator. So \(P(\text{disease}\mid\text{positive})\) asks what fraction of positive tests come from people with the disease, and by contrast \(P(\text{positive}\mid\text{disease})\) asks what fraction of diseased people receive positive tests. A two-way table is often the safest way to keep those denominators separate.
Bayes’ theorem
The same calculation can be written as
\[P(D\mid +) = \frac{P(+\mid D)P(D)}{P(+)}\]where the denominator can be expanded as \(P(+) = P(+\mid D)P(D) + P(+\mid D^c)P(D^c)\). This is Bayes’ theorem, and the population-count approach and the formula are doing the same calculation. For many students, the count table is easier to interpret because each term corresponds to an actual subgroup.