# Bayes theorem, answer way too small something wrong?

1. Feb 16, 2015

### ilyas.h

im sure i followed it correctly but my answer is unusually small...

1 in a thousand people have a disease. A company has discovered a new method for testing for the disease.
If a person has the disease, the test will return a +ve result 99% of the time.
If a person doesn't have the disease, the test will return a +ve result 2% of the time.

what is the probability of a person having the disease, given that they have a +ve result?

components:

D = 0.001 (1 in a 1000...)
P(+ve | D) = 0.99
P(+ve | not D) = 0.02

asked to find: P(D | +ve).

Formula (bayes theorem):

P(D | +ve) =

P(D)P(+ve | D)
-----------------------------------------------------
P(D)P(+ve | D) + P(not D)P(+ve | not D)

if you plug in the values you get P(D | +ve) = 0.0472

this is clearly too small, if the result was +ve, you'd expect a substantial amount of the +ve cohort to actually have the disease. I've checked the formula 100 times and everything seems correct.

2. Feb 16, 2015

### phyzguy

Your answer is correct. Think of it this way. Suppose I test 1000 people, chosen at random. On the average, 1 of these people will have the disease, and 999 people will not. The test will probably (99% of the time) give a positive result for the one person who has the disease, but it will also give a positive result for 2% of the 999 people who don't have the disease. So there will be about 20 false positives (2% of 999). So, if you get a positive result, there is only about a 1/21 (4.7%) chance that you actually have the disease. This is the point of the exercise, since the result is so different from your intuition. Does this make sense?

3. Feb 16, 2015

### ilyas.h

oh, i understand.

only a small number of people of the thousand will have a +ve result.

1 x 0.99 + 999 x 0.02 = [0.99] + [19.98]

so 0.99 people will have the disease given +ve result (estimate).
19.98 people will not have disease given +ve result (estimate).

so of the +ve people:

0.99/ ([0.99] + [19.98]) = 0.0472

is my logic correct? thanks for your help.

4. Feb 16, 2015

### PeroK

Yes, that's correct. It's interesting how unintuitive this is.

Here's another way of looking at it. Suppose no-one had the disease (or almost no-one), what would be the percentage of false positives out of all positives?

5. Feb 16, 2015

### ilyas.h

wouldn't it just be 20 in this case?

no one has disease, 0/02 x 1000 = 20.

6. Feb 16, 2015

### PeroK

The point is that 100% of the positives are false.

7. Feb 16, 2015