Interactive statistics

56 free interactive lessons: from mean and median to A/B tests and Bayes. Drag the charts and build intuition. No sign-up.

Module 2: Probability

Conditional probability and rare events

Randomness does not only deceive on small samples. There is a trickier trap: even a very accurate test for a rare disease produces a flood of false alarms. Let's see why β€” this is conditional probability.

Out of 1000 people, β‰ˆ 10 are sick; the test is positive for β‰ˆ 108.
All positive tests:actually sick: 9false alarms: 99
P(sick | test positive) = 8%
Bayes’ theorem (live numbers):
P(sick | +) = P(sick)Β·P(+|sick) / [ P(sick)Β·P(+|sick) + P(healthy)Β·P(+|healthy) ]
= (0.010Β·0.90) / [ 0.010Β·0.90 + 0.990Β·0.10 ] = 8%
P(sick) is the base rate (prevalence), P(+|sick) is the test accuracy. Drag the sliders β€” the formula recomputes.

Take a disease that affects 1 person in 100, and a test that is 90% accurate. The test comes back positive for some people. The bar shows everyone whose test fired: teal β€” actually sick, yellow β€” healthy people with a false alarm.

Why this matters

This trap is real in medicine: when screening for rare diseases, most positive results turn out false, so the first test is followed by a confirmatory, more precise one.

The same effect drives fraud and spam filters: if fraud is rare, even a good detector will bury you in false alarms unless the base rate is taken into account.

Where it shows up

Breathalyzers, lie detectors, "suspicious person" recognition in crowds β€” all suffer from this: with a rare event and good accuracy, the absolute number of false alarms is huge.

A competent conclusion therefore always weighs not only "how accurate is the test" but also "how rare is the event itself".

Definitions
Conditional probability
the probability of an event given that another is known. P(sick | test +) is not the same as P(test + | sick).
Base rate (prior)
how common the event is in general, before any test. Rarity drastically changes what a positive result means.
Bayes’ theoremP(A∣B)=P(A)β‹…P(B∣A)P(B)P(A \mid B) = \dfrac{P(A)\cdot P(B \mid A)}{P(B)}
how to update the probability of A after observing B, accounting for both the test's accuracy and the base rate P(A).
Next β†’
Enjoying the materials?

This site is built by the DataSlice Telegram channel: data analytics in plain words β€” real cases, metrics, careers. The channel is in Russian.

Open the Telegram channel