Reliability of tests

When dealing with a test, always ask yourself how reliable the test is. That is, ask yourself what the probability of true positives and the probability of true negatives are. Suppose we test for a disease D, and we designate a positive result with P and a negative result with -P. Then, we want to know two things:

1. Pr(P|D)
2. Pr(-P|-D)

Notice that from (1) we can immediately obtain Pr(-P|D), the probability of false negatives; similarly, from (2) we can immediately obtain Pr(P|-D), the probability of false positives.
For example, suppose that we have diagnosed 100 people with the disease D and we have given them the test. Suppose also that 95 tested positive and 5 negative. Then, Pr(P|D)=95%, and Pr(-P|D)=5%. In addition, suppose that we give the test to 100 people who do not have the disease and that 80 test negative and 20 test positive. Then, Pr(-P|-D)=80%, and Pr(P|-D)=20%.
So, suppose you test positive to a test for a disease D. What's the probability that you do have the disease? That is, what's Pr(D|P)? As we saw, that is a function of (1), (2), and Pr(D), the prior probability that you have the disease.