Bayes’ Theorem: COVID tests

Assume that 0.5% of people have COVID. Suppose a COVID test gives a (true) positive on 96% of patients who have COVID, but gives a (false) positive on 2% of patients who do not have COVID. Bob tests positive. What is the probability that Bob has COVID?

Solution

(1) Label events:

  • Event AP: Bob is actually positive for COVID
  • Event AN: Bob is actually negative; note AN=APc
  • Event TP: Bob tests positive
  • Event TN: Bob tests negative; note TN=TPc

(2) Identify known data:

  • Know: P[TP|AP]=96%
  • Know: P[TP|AN]=2%
  • Know: P[AP]=0.5% and therefore P[AN]=99.5%

We seek: P[AP|TP]


(3) Translate Bayes’ Theorem:

Set A=TP and B=AP in Bayes’:

P[AP|TP]=P[AP]P[TP|AP]P[TP]

We know all values on the right except P[TP]


(4) Denominator: apply Total Probability (Division into Cases):

Observe that TPAP and TPAN are exclusive events, and that:

TP=TPAPTPAN.

Therefore:

P[TP]=P[AP]P[TP|AP]+P[AN]P[TP|AN]

Plug in data and compute:

P[TP]=5100096100+995100021000.0247

(5) Plug in and compute:

P[AP|TP]=P[AP]P[TP|AP]P[TP]0.960.0050.024719%

Intuition - COVID testing

Some people find this low number surprising. In order to repair your intuition, think about it like this: roughly 2.5% of tests are positive, with roughly 2% coming from false positives, and roughly 0.5% from true positives. Only 1/5 of all the positive results are true ones!

(This rough approximation assumes that 96%100%.)

If two tests both come back positive, the odds of COVID are now 98%.

If only people with symptoms are tested, so that, say, 20% of those tested have COVID, that is, P[AP|TP]=20%, then one positive test implies a COVID probability of 92%.

Inferring bin from marble

There are marbles in bins in a room:

  • Bin 1 holds 7 red and 5 green marbles.
  • Bin 2 holds 4 red and 3 green marbles.

Your friend goes in the room, shuts the door, and selects a random bin, then draws a random marble. (Equal odds for each bin, then equal odds for each marble in that bin.) He comes out and shows you a red marble.

What is the probability that this red marble was taken from Bin 1?