Bayes' Theorem probability testing for a virus

4.9k Views Asked by At

I am trying to translate the following question into input for the Bayes' theorem.

What i have currently is P(V|A) = 0.95 which is the probability of having the virus given that test A recognises it which is 95%, and P(V|~A) = 0.10 which is the prob of having the virus given that the test doesn't detect it, Also P(V) = 0.01 because 1% of people have the virus.

I am wondering if i have misinterpreted the "Test A" part of the question?

Consider two tests, A and B, for a virus. Test A is 95% effective at recognizing the virus when it is present (that is 95% of the time that the virus is present, the test detects it), but has a 10% false positive rate (that is, 10% of the time it indicates the virus is present when it is not). Test B is 90% effective at recognizing the virus, but has a 5% false positive rate. The two test use different, independent, methods of indentifying the virus. 1% of all people have the virus. Joe tests positive for the virus using test A. Bob tests positive using test B. Who is more likely to have the virus?

3

There are 3 best solutions below

0
On BEST ANSWER

The false positive rate is $P(A\mid\sim V)$ (probability the test erroneously comes back positive when you don't have the virus) and the effectiveness is $P(A\mid V)$ (probability the test correctly comes back positive when the virus is present). You use these, $P(V)$ (which you identified correctly) and bayes to figure out $P(V\mid A)$, the probability a person actually has the virus if they tested positive.

0
On

$P(V|A)$ is not $0.95$. It is opposite:
$$P(A|V) = 0.95$$ From the text we can also conclude, that $$P(A|\sim V) = 0.1$$ $$P(B|V) = 0.9$$ $$P(B|\sim V) = 0.05$$ $$P(V) = 0.01$$ $$P(\sim V) = 0.99$$
What you need to calculate and compare is $P(V|A)$ and $P(V|B)$

$$P(V\cap A) = P(A)\cdot P(V|A) \Rightarrow P(V|A) = \frac{P(V \cap A)}{P(A)} $$ $P(V \cap A)$ means, that Joe has a virus and it is detected, so $$P(V \cap A) = P(V)\cdot P(A|V) = 0.01 \cdot 0.95 = 0.0095$$ $P(A)$ is sum of two options: "Joe has virus and it is detected" and "Joe has no virus, but it was mistakenly detected", therefore: $$P(A) = P(V)\cdot P(A|V) + P(\sim V) \cdot P(A|\sim V) = 0.01\cdot 0.95 + 0.99\cdot 0.1 = 0.1085$$ Dividing those two numbers we obtain $$P(V|A) = \frac{0.0095}{0.1085} = 0.08755760368663594$$ Analogically, $$P(V|B) = \frac{P(V \cap B)}{P(B)} = \frac{P(V) \cdot P(B|V)}{P(V)\cdot P(B|V) + P(\sim V) \cdot P(B|\sim V)} = \frac{0.01 \cdot 0.9}{0.01 \cdot 0.9+0.99 \cdot 0.1} = 0.1538461538461539$$
We observe, that $P(V|B) \gt P(V|A)$, so Bob is more likely to have virus, however is is still very small probability (only 15%), so in order to confirm illness, he should make one more test.

0
On

In the above response, everything looks good but there is a minor typo for the values for the equation for $P(V|B)$

In the bottom part, $P(B|~V)$ should have been $0.05$ (since it is only $5$% false positive), but it was written as $0.1$

The final answer for $P(V|B)$ is $0.1538461538461539$ accurate though.