A person tests positive for a disease.
What is the probability of the person having the disease?
Let
\(t\) | denote the event “tests positive” and | |
\(d\) | denote the event “has the disease”. |
We know that
\[\begin{align*} P(d) & = 1 / 5000 = 0.0002, && \text{\(1\) in \(5000\) prevalence} \\ P(t | d) & = 0.99, && \text{\(99\%\) true positives} \\ P(\lnot t | \lnot d) & = 1. && \text{\(100\%\) true negatives} \end{align*} \]
We must find
\[\begin{equation*} P(d | t). \end{equation*} \]
N.B. We cannot use the Bayes’ theorem right away because \(P(t)\) is unknown.
\[\begin{equation*} P(t | \lnot d) = 1 - P(t | d) = 1 - 0.99 = 0.01. \end{equation*} \]
\[\begin{equation*} P(\lnot d) = 1 - P(d) = 1 - 1 / 5000 = 0.9998. \end{equation*} \]
\[\begin{align*} P(t) & = P(t | d) \, P(d) + P(t | \lnot d) \, P(\lnot d) \\ & = 0.99 \cdot 0.0002 + 0.01 \cdot 0.9998 \\ & = 0.010196 \end{align*} \]
using the law of total probability.
\[\begin{equation*} P(d | t) = \frac{P(d) \, P(t | d)}{P(t)} = \frac{0.0002 \cdot 0.99}{0.010196} \approx 0.0194193 \\ = 2\% \end{equation*} \]
using the Bayes’ theorem.