Test results, part 2: how about negative results?

This is part 2 of this article:

To recap: there’s a pandemic going on, 1% of people have the virus. There’s a test that can detect the virus, and the test is 99% reliable (for both positive and negative results).

But this time, when you take the test, the result is negative. How much can you trust that result?

Ideal case

If you know nothing else besides the test result, then it’s very reliable: 99.9898%, which is basically 100%.

I will not repeat the analysis, please refer to Part 1. But, again, this is the ideal case scenario. What happens in reality?

In the real world

Turns out, the negative result remains very robustly trustworthy even when the infection rate grows very large (or you’re in a cohort with a large infection rate).

  • at 10% infection rate, the test is still 99.9% reliable
  • at 50% infection rate, it’s 99% reliable
  • at 90% infection rate, it’s 91.7% reliable
  • at 99% infection rate, it finally drops to 50% reliability (coin toss)

Here’s the graph:

reliability of a negative result as a function of infection rate
reliability of a negative result as a function of infection rate

If the general population is at 1% infection rate, you’d have to be in a very specific cohort to not trust the negative result.

For example, if this particular disease has extremely specific symptoms that do not occur with any other disease, and you do have those symptoms, and you get a negative test result, then you should question the test, because you’re in a cohort that’s pretty much guaranteed to have the virus, no matter what the test says.

Other than that, the negative result tends to be pretty robust.


healthy.chance <- function(inf.rate, test.rel = 0.99, tot.pop = 10000) {
sick.pop <- tot.pop * inf.rate
healthy.pop <- tot.pop - sick.pop
pos.sick <- sick.pop * test.rel
neg.sick <- sick.pop - pos.sick
neg.healthy <- healthy.pop * test.rel
neg.total <- neg.sick + neg.healthy
chance <- neg.healthy / neg.total
infection.rate <- 1:100 / 100
chances <- lapply(infection.rate, healthy.chance)
plot(infection.rate, chances, col = 'blue'); grid()

That’s all, thanks for reading!

Graduated Physics. Working in the computer industry. Studying statistics, visualizations, data science.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store