Bayes' theorem in practice

338 Views Asked by At

Question: What probability is that a person with a positive test is HIV+, when these facts apply: One person out of 1000 is HIV+. Test of a HIV+ person is always positive. Test of a HIV- person is positive with a probability of 1/100. Bayes gives: $P=\frac{P(T+|HIV+)P(HIV+)}{P(T+|HIV+)P(HIV+)+P(T+|HIV-)P(HIV-)}=\frac{1\frac1{1000}}{1\frac1{1000}+\frac1{100}\frac{999}{1000}}=\frac{100}{1999}$.
This result doesn't correspond to my thinking. When I take 1000 people, there is 11 guys with positive tests and one of them is HIV+, which leads to probability of 1/11, but thats not true. Could someone please explain to me where are my assumptions wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

You've just miscalculated a couple of times, that's all.

First, when you apply the Bayes formula, the final step should be like this: $$ P = \frac{1\cdot \frac{1}{1000}}{1\cdot \frac{1}{1000} + \frac{1}{100}\frac{999}{1000}} = \frac{100}{100 + 999} = \frac{100}{1099}. $$

This is very close to $\frac{1}{11}$ which you get in the second part of your question. The match is approximate because your calculation in second part also contains a small error. Out of $1000$ people, $1$ is HIV+ and $9.99$ have HIV- but positive test results, so there are $10.99$ patients with positive test, not $11$.

To avoid talking about fractional patients, start with $100000$ people. Of them, $100$ are HIV+ (and thus have positive test result). The remaining $99900$ people are HIV-, and $999$ of them have positive test result. So we have $1099$ positive test results, and only $100$ of them are actually HIV+. Again, we come to the answer $\frac{100}{1099}$.