Puzzler No. 0 25 July 2024 8 min
Econometrics Puzzler #0: Is it Better to Improve Sensitivity or Specificity?
Here’s a slightly unusual exercise on the topic of Bayes’ Theorem for those of you teaching or studying introductory probability.1 Imagine that you’re developing a diagnostic test for a disease. The test is very simple: it either comes back positive or negative. You have a choice between slightly increasing either your test’s sensitivity or its specificity. If your goal is to maximize the positive predictive value (PPV) of your test, i.e. the probability that a patient has the disease given that the test comes back positive, which test characteristic should you choose to improve?
1 What follows started life as a regular post, but I later realized it was a puzzler in disguise! To keep the numbering of the other puzzlers unchanged, I have retroactively dubbed this one “puzzler zero”.
1 Odds aren’t so odd!
While I give you a few minutes to pause and ponder this question, here’s a brief rant on the topic of odds. If you’re anything like me, the first time you encountered odds, you thought to yourself
What is this $*@%^!? Why would anyone want to spoil a perfectly good probability by dividing it by one minus itself?“2
2 I know first-hand that this sentiment is shared by at least one distinguished professor of probability theory, so at least I’m not completely alone in my earlier view of things!
But it’s time to take the red pill and see the world as it really is: the only reason you prefer to think in terms of probabilities rather than odds is because you’ve been brainwashed by the educational system. Of course I exaggerate slightly, but the point is that odds are just as natural as probabilities; we’re just not as accustomed to working with them. In many situations in probability, statistics, and econometrics, it turns out that working with odds (or their logarithm) makes life much simpler, as I will try to convince you with a simple example.
First we need to define odds. Consider some event \(A\) with probability \(p\) of occurring. Then we say that the odds of \(A\) are \(p/(1 - p)\). For example, if \(p = 1/3\) then the event \(A\) is equivalent to drawing a red ball from an urn that contains one red and two blue balls: the probability gives the ratio of red balls to total balls. The odds of \(A\), on the other hand, equal \(1/2\): odds give the ratio of red balls to blue balls. Since probabilities are between 0 and 1, odds are between 0 and \(\infty\). Odds of 0 mean that the event is impossible, while odds of \(\infty\) mean that the event is certain. Odds of 1 mean that the event is just as likely to occur as not to occur.
Now here’s an example that you’ve surely seen before:
One in a hundred women has breast cancer \((B)\). If you have breast cancer, there is a 95% chance that you will test positive \((+)\); if you do not have breast cancer \((B^C)\), there is a 2% chance that you will nonetheless test positive \((+)\). We know nothing about Alice other than the fact that she tested positive. How likely is it that she has breast cancer?
It’s easy enough to solve this problem using Bayes’ Theorem, as long as you have pen and paper handy: \[ \begin{aligned} P(B | +) &= \frac{P(+|B)P(B)}{P(+)} = \frac{P(+|B)P(B)}{P(+|B)P(B) + P(+|B^C)P(B^C)}\\ &= \frac{0.95 \times 0.01}{0.95 \times 0.01 + 0.02 \times 0.99} \approx 0.32. \end{aligned} \] But what if I asked you how the result would change if only one in a thousand women had breast cancer? What if I changed the sensitivity of the test from 95% to 99% or the specificity from 98% to 95%? If you’re anything like me, you would struggle to do these calculations in your head. That’s because \(P(B|+)\) is a highly non-linear function of \(P(B)\), \(P(+|B)\), and \(P(+|B^C)\).
In contrast, working with odds makes this problem a snap. The key point is that \(P(B|+)\) and \(P(B^C|+)\) have the same denominator, namely \(P(+)\): \[ P(B | +) = \frac{P(+|B)P(B)}{P(+)}, \quad P(B^C | +) = \frac{P(+|B^C)P(B^C)}{P(+)} \] Notice that \(P(+)\) was the “complicated” term in \(P(B|+)\); the numerator was simple. Since the odds of \(B\) given \((+)\) is defined as the ratio of \(P(B|+)\) to \(P(B^C|+)\), the denominator cancels and we’re left with \[ \text{Odds}(B|+) \equiv \frac{P(B|+)}{P(B^C|+)} = \frac{P(+|B)}{P(+|B^C)} \times \frac{P(B)}{P(B^C)}. \] In other words, the posterior odds of \(B\) equal the likelihood ratio, \(P(+|B)/P(+|B^C)\), multiplied by the prior odds of \(B\), \(P(B)/P(B^C)\): \[ \text{Posterior Odds} = \text{(Likelihood Ratio)} \times \text{(Prior Odds)}. \] Now we can easily solve the original problem in our head. The prior odds are 1/99 while the likelihood ratio is 95/2. Rounding these to 0.01 and 50 respectively, we find that the posterior odds are around 1/2. This means that Alice’s chance of having breast cancer is roughly equivalent to the chance of drawing a red ball from an urn with one red and two blue balls. There’s no need to convert this back to a probability since we can already answer the question: it’s considerably more likely that Alice does not have breast cancer. But if you insist, odds of 1/2 give a probability of 1/3, so in spite of rounding and calculating in our heads we’re within 0.3% of the exact answer!
Repeat after me: odds are on a multiplicative scale. This is their key virtue and the reason why they make it so easy to explore variations on the original problem. If one in a thousand women has breast cancer, the prior odds become 1/999 so we simply divide our previous result by 10, giving posterior odds of around 1/20. If we instead changed the sensitivity from 95% to 99% and the specificity from 98% to 95%, then the likelihood ratio would change from \(95/2 \approx 50\) to \(99/5 \approx 20\).