Demonstration of Bayes' Law
You can change the proportions and see the results (hit return or go to another field after changing the value).
Question: If a person is tests positive, what is the probability the person has the disease?
Expected frequencies for 10,000 people.
198 + 882 = 1080 test positive.
198/1080 = 0.1833 of those testing positive have the disease.
Therefore, the probability that one has the disease given that they test positive P(D|T) is:
The same answer can be computed with Bayes's Theorem:
P(D|T) = Probability of having the disease if you tested positive.
P(T|D) = Probability of testing positive if you have the disease.
P(T|D') = Probability of testing postive if you do not have the disease.
P(D) = Probability of the disease.
P(D') = Probability of not having the disease.
For this example:
P(T|D) = 0.99
P(T|D') = 0.09
P(D) = 0.02
P(D') = 0.98