Probability & Statistics

A Positive Test

A disease hits 0.5 percent of people, and a test never misses a real case but flags 7 percent of healthy people. A random stranger tests positive. How worried should they be?

solvedmedium1 min

A disease occurs with probability 0.5%0.5\% in the population. A test returns positive for sure if you have the disease, and gives a false positive 7%7\% of the time if you do not. A random stranger tests positive. What is the probability that the stranger has the disease?

Reveal solutionHide solution

#Bayes with a rare disease

P(D+)=P(+D)P(D)P(+D)P(D)+P(+¬D)P(¬D)=10.00510.005+0.070.995.(1)\PP(D \mid +) = \frac{\PP(+ \mid D)\,\PP(D)}{\PP(+ \mid D)\,\PP(D) + \PP(+ \mid \neg D)\,\PP(\neg D)} = \frac{1 \cdot 0.005}{1 \cdot 0.005 + 0.07 \cdot 0.995}. \tag{1}

#Crunch the numbers

=0.0050.005+0.06965=0.0050.074650.067.(2)= \frac{0.005}{0.005 + 0.06965} = \frac{0.005}{0.07465} \approx 0.067. \tag{2}
truly sickfalse alarm
Out of ten thousand people, fifty carry the disease and all test positive, but seven percent of the 9950 healthy add about 697 false alarms. The genuinely sick are a thin sliver of all positives, so a positive stranger is sick only about 6.7 percent of the time.

#Result

The probability is about 6.7%6.7\%. Even a test that never misses a true case leaves a positive stranger far more likely healthy than sick, because the 7%7\% false positives drawn from the 99.5%99.5\% healthy majority swamp the tiny 0.5%0.5\% who are genuinely ill. This is the base-rate fallacy.