+ Diagnostic Testing
+
+
+ Diagnostic tests for diseases aren't perfect.
+ When a test comes back positive or negative, a patient will want to understand the (conditional) probability that they have or don't have the disease based on the evidence (the diagnostic test result).
+
+
+
+
+
+ The sensitivity of a diagnostic test is the probability that a patient who has the disease will see a positive test result.
+ The specificity is the probability that a patient who does not have the disease will see a negative test result.
+
+
+
+
+
+ Introducing event notation, let D be the event that a patient has the disease, and let P be the event that they receive a positive test result.
+ Then the sensitivity of the diagnostic test is \Pr(P \mid D), and the specificity is \Pr(P^c \mid D^c).
+ However, when the patient takes a diagnostic test, the conditional probabilities they would be most interested in would be \Pr(D \mid P) and \Pr(D^c \mid P^c).
+
+
+
+ Bayes' Theorem expresses the relationship between a conditional probability \Pr(A \mid B) and the flipped conditional probability \Pr(B \mid A).
+
+
+
+ Bayes' Theorem (v1)
+
+
+
+
+ \Pr(B \mid A) = \frac{\Pr(A \mid B)\Pr(B)}{\Pr(A)}
+
+
+
+
+
+
+ For example, if a patient sees a positive diagnostic test result, they might try to calculate:
+
+ \Pr(D \mid P) = \frac{\Pr(P \mid D)\Pr(D)}{\Pr(P)}
+
+ It will take some work to be able to use this formula.
+ We likely don't have direct access to \Pr(P) or \Pr(D).
+
+
+
+ Let's consider \Pr(P), the probability of receiving a positive test result.
+ The sensitivity \Pr(P \mid D) tells us this probability under the condition that the patient has the disease.
+ For a patient who doesn't have the disease, the specificity isn't quite the number we're looking for.
+ However, consider the complementary probability:
+
+ \Pr(P \mid D^c) = 1 - \Pr(P^c \mid D^c)
+
+ The total \Pr(P) can be divided into two categories: patients who have the disease and test positive, and patients who don't have the disease and test positive.
+ So:
+
+ \Pr(P) \amp = \Pr(P\cap D) + \Pr(P\cap D^c)
+ \amp = \Pr(P\mid D)\Pr(D) + \Pr(P \mid D^c)\Pr(D^c)
+ \amp = \Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c \mid D^c))\Pr(D^c)
+ \amp = (\text{sensitivity})\Pr(D) + (1 - \text{ specificity})\Pr(D^c)
+
+ We can take this breakdown of \Pr(P) and write a new version of Bayes' Theorem:
+
+
+
+ Bayes' Theorem (v2)
+
+
+
+
+ \Pr(B \mid A) = \frac{\Pr(A \mid B)\Pr(B)}{\Pr(A \mid B)\Pr(B) + (1 - \Pr(A^c \mid B^c))\Pr(B^c)}
+
+
+
+
+
+
+ We're still missing a crucial piece of information: \Pr(D), the probability (not conditioned on any evidence) that the patient has the disease.
+ This is often referred to as the prior, as in, our prior understanding of the probability of something before we gained some new information from evidence.
+ The conditional probability calculated using Bayes' Theorem is usually called the posterior (i.e., after taking evidence into account).
+ There isn't always one single number that's reasonable to use as the prior probability.
+ For example, in a diagnostic testing situation, the prevalence of the diseasei.e., the proportion of the population who have the diseasemight feel like a natural number to use as the prior.
+ However, what prevalence should you use? During the COVID-19 pandemic, the prevalence of COVID in a particular country, state, and city might be different.
+ There's also the possibility of applying Bayes' Theorem multiple times to take into account multiple pieces of evidence, using the posterior probability from one application of Bayes' Theorem to play the role of the prior probability in the next.
+ This idea would apply if, for example, a patient took a second diagnostic test to double-check.
+
+
+
+
+
+ A 50-year old woman with no symptoms is screened for breast cancer and tests positive.
+ If the prevalence of breast cancer for women in her age group is 1% and the particular screening process used has a sensitivity of 90% and a specificity of 91%, what is the probability that the woman has breast cancer given her positive result?
+
+
+
+
+
+ Let P be the event of testing positive and D the event of having the disease.
+ Then the prevalence \Pr(D) is given as 1%, or 0.01.
+ The sensitivity is \Pr(P\mid D) = 0.9, and the specificity is \Pr(P^c\mid D^c) = 0.91.
+ So, according to Bayes' Theorem:
+
+ \Pr(D\mid P) \amp = \frac{\Pr(P\mid D)\Pr(D)}{\Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c\mid D^c))\Pr(D^c)}
+ \amp = \frac{(0.9)(0.01)}{(0.9)(0.01) + (1 - 0.91)(1 - 0.01)}
+ \amp \approx 0.092
+
+
+
+
+