In this lesson, we will use Bayes' rule to aid in decisions in a diagnostic testing setting. In the early 1980's, the human immunodeficiency virus, or HIV, had just been discovered. And it was recognized as a rapidly expending health epidemic. A false negative result for a communicable disease is a very important personal and public health concern, specifically for HIV in the U.S. at the time, the safety of the blood supply was a major issue. However, false positives also carried a lot of weight at the time due to the stigma associated with testing positive for HIV, as well as a complete lack of treatment options. In the mid-1980's, an HIV diagnosis was basically a death sentence and misdiagnosis of HIV infection had serious personal consequences for a large number of patients. An example of an organization that developed a rigorous testing for HIV was the U.S. Military, which used the following procedure for testing recruits. First, all applicants were screened with an enzyme linked immune absorbent SA, which is commonly referred to as an ELISA. If the samples tested positive then two more rounds of the same ELISA were performed. If either of those test yielded a positive result, then two Western Blot assays, that were more cumbersome to conduct, but had higher accuracy were performed. Only if both of those tests were positive, did the military determine the recruit to have an HIV infection, based on papers published at the time. For the ELISA, the true positive also refer to as the sensitivity of the test was around 93%, and the true negative rate also refer to as the specificity of the test was around 99%. For the Western block, the sensitivity was around 99.9% and the specificity was around 99.1%. We also know that by the mid 1980's, it was estimated that 1.48 / 1000 adult Americans were HIV positive. Note that it's quite difficult to track down exact sensitivity and specificity numbers for these ALT tests, as well as the prevalence at the time. So these values are approximate based on what was published at the time. In this lesson, we will use Bayes Rule to calculate the probability that a recruit who tested positive in the first ELISA actually has HIV. Then in the next lesson, we will consider the sequential testing results. Let's take another look at these probabilities. The prevalence can be denoted as probability of having HIV is .00148, the sensitivity can be denoted as Probability of positive, given HIV is 0.93, and the specificity can be denoted as probability of negative, given no HIV is 0.99. Prior to any testing, what probability should be assigned for recruit having HIV? Given that we don't have any additional information about this recruit, our best guess is that they are a randomly sampled individual from this population. Hence, the prior probability we assign to this recruit having HIV is simply the prevalence of the disease in the population. That is, probability of HIV is 000148. This is called the prior probability. When a recruit goes through HIV screening, there are two competing claims, recruit has HIV and recruit doesn't have HIV. If the ELISA yields a positive result, what is the probability that this recruit has HIV? Remember that we already decided what the prior probabilities to be assigned to these two competing hypothesis should be. The prior probability of the hypothesis that the recruit has HIV is 0.00148, and the prior for the competing hypothesis that the recruit does not have HIV is simply the compliment of this probability. If the recruit actually has HIV, there are two possible outcomes for the test, a positive or a negative. The sensitivity of the test tells us that the probability of a positive test result given that the person has HIV is 0.93, and enhance the probability of a false negative result, that is the probability of testing negative even if the person has HIV, is the complement of this, 0.07. Similarly, if the recruit actually does not have HIV, there are again two possible outcomes for a test, a positive or a negative. The specificity of the test tells us that the probability of a negative test result, given that the person does not have HIV, is 0.99, and hence the probability of a false positive result, that is positive given no HIV, is the complement of this, 0.01. Remember that we're looking for the probability that the recruit has HIV given that they tested positive. Using base rule, we can calculate this probability as probability of HIV and positive divided by the probability of positive. The probability tree makes it easy to track down these probabilities. By multiplying across the branches, we can obtain the probabilities of HIV in positive, and no HIV in positive. Note that to calculate these probabilities, we've made use of base rule again. For example, to obtain the probability of HIV in positive, we multiplied probability of HIV with probability of positive given HIV. Finally, we have all the pieces we need to calculate the conditional probability of interest. Probability of HIV and positive is on the top rank. To calculate the overall probability of positive, we need to keep in mind. But a person can test positive and have HIV, or they can test positive even though they don't have HIV. Because we said or we add these two probabilities in the dominator to obtain the overall probability of testing positive. This yields 0.12 as the probability that the recruit has HIV given that they tested positive on the first ELISA. This is called the posterior probability. We can see that the probability of having the disease, given a positive test is highly dependent on both the false positive and false negative rates of the test, as well as the prior probability we assumed for the individual.