Bayes in screening
A thousand people, split by illness and test result. Change the prevalence, sensitivity and false-positive rate and see what share of positives are really ill; then retest the positives.
- ill · positive
- healthy · positive
- ill · negative
- healthy · negative
positives 89of them ill 10share (whole people) 10/89 ≈ 0.112
Experiment idea from: github.com/huzhuofan1020-svg/ybs
What did you observe?Play first, then answer. Read the explanation only after you have thought it through.
- 1.With the default settings, how many of the positives are actually ill? Why is that share so low when the sensitivity is 95%?
- 2.Drag the prevalence from 1% to 20%. How does the posterior change? The test itself has not changed.
- 3.Turn on “Retest the positives”. Why does the same test, taken a second time, give a much more reliable answer?
With the defaults, the roughly ill people are almost all caught, but about of the healthy people test positive too: of about positives only about are ill. Sensitivity is ; what we want is , and between them stands the prior: the ill are so rare that false alarms outnumber true ones. Raise the prevalence and the same test gives a much higher posterior, so the same lab report means different things in different populations. On retesting, the prevalence among first-time positives is already , not : yesterday's posterior is today's prior, and the posterior jumps to about . This assumes the two tests err independently given the true state; if false alarms come from some persistent trait of the person, retesting helps much less.
Related concept: Conditioning & Bayes
Discussion
Found a mistake, have a question or a suggestion? You can also write to 620026600@qq.com
No comments yet. Share your understanding, ask a question, or point out an error on this page.
Log in to join the discussion