Subsection 1.3.2 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).
Definition 1.3.3.
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)\text{,}\) and the specificity is
\(\Pr(P^c \mid D^c)\text{.}\) 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)\text{.}\)
Bayesโ Theorem expresses the relationship between a conditional probability
\(\Pr(A \mid B)\) and the flipped conditional probability
\(\Pr(B \mid A)\text{.}\)
Theorem 1.3.4. Bayesโ Theorem (v1).
\begin{gather*}
\Pr(B \mid A) = \frac{\Pr(A \mid B)\Pr(B)}{\Pr(A)}
\end{gather*}
For example, if a patient sees a positive diagnostic test result, they might try to calculate:
\begin{gather*}
\Pr(D \mid P) = \frac{\Pr(P \mid D)\Pr(D)}{\Pr(P)}
\end{gather*}
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)\text{.}\)
Letโs consider \(\Pr(P)\text{,}\) 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:
\begin{gather*}
\Pr(P \mid D^c) = 1 - \Pr(P^c \mid D^c)
\end{gather*}
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:
\begin{align}
\Pr(P) \amp = \Pr(P\cap D) + \Pr(P\cap D^c) \tag{1.3.1}\\
\amp = \Pr(P\mid D)\Pr(D) + \Pr(P \mid D^c)\Pr(D^c) \tag{1.3.2}\\
\amp = \Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c \mid D^c))\Pr(D^c) \tag{1.3.3}\\
\amp = (\text{sensitivity})\Pr(D) + (1 - \text{ specificity})\Pr(D^c) \tag{1.3.4}
\end{align}
We can take this breakdown of \(\Pr(P)\) and write a new version of Bayesโ Theorem:
Theorem 1.3.5. Bayesโ Theorem (v2).
\begin{gather*}
\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)}
\end{gather*}
Weโre still missing a crucial piece of information:
\(\Pr(D)\text{,}\) 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 diseaseโi.e., the proportion of the population who have the diseaseโmight 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.
Example 1.3.6.
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?
Solution.
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\text{,}\) and the specificity is \(\Pr(P^c\mid D^c) = 0.91\text{.}\) So, according to Bayesโ Theorem:
\begin{align*}
\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
\end{align*}