Rudolf Adamkovič Personal site


Use

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.

  1. Find the probability of false positives
    \[\begin{equation*}
      P(t | \lnot d) = 1 - P(t | d) = 1 - 0.99 = 0.01.
    \end{equation*}
    \]
  2. Find the probability of not having the disease
    \[\begin{equation*}
      P(\lnot d) = 1 - P(d) = 1 - 1 / 5000 = 0.9998.
    \end{equation*}
    \]
  3. Find the probability of testing positive
    \[\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.

  4. Find the probability of having the disease given a positive test
    \[\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.

(Webb & Sidebotham, 2020)


© 2024 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and the secret alien technologies of yesteryear.