The surprising truth about medical tests



Mats Andersson wrote: Say that we have a city with 1 million people, and that 100 of them are terrorists. Say that we have a terrorist detection machine, that will identify a terrorist with 99% certainty—that is, it will correctly identify a terrorist 99 times out of 100. The machine will also give false positives. It will incorrectly identify a normal person as a terrorist 1% of the time; that is, if you use it on 100 people who are not terrorists, it will still flag one of them. A person is tested by the machine, and it goes “Bing! Terrorist!” What is the chance that the person actually is a terrorist?

Question: Is it 99%, 50%, 1% or some other value?

Scroll down for the answer.



































Correct answer: about 1%.

Mats Andersson added: Sadly, the same mathematics apply to medical tests, and most doctors are completely ignorant of this. If you have the same city, and 100 people in it are HIV positive, and your test similarly identifies 99% of those who are, but incorrectly flags 1% of those who aren’t—then this means that if you get your test back and it’s positive, it’s way more likely that you are not HIV positive. But most doctors will say it’s 99% likely. A fairly large proportion will say it’s 50%. Some will even say it’s completely certain.

My Explanation
Let us divide the population of one million into 100 terrorists and 999,900 normals. Applying our machine to the group of normals we will get 1% false positives, ie 9,999 false accusations of terrorism. On the terrorist group, our machine will correctly identify 99%, ie 99 terrorists, and one slipping through undetected. So in total, the machine has given 99 correct and 9,999 incorrect positive results. Thus the chance that a positive result is an actual terrorist is 99/(9,999 + 99) ie 99/10,098 = 0.98%, ie just under 1%.

As Andersson points out, this kind of probability reasoning applies to medical tests, which invariably have an error rate, usually much more than 1%. So this little puzzle is important in the real world. If a test is 95% reliable and reports that you have a rare cancer, how much credence should you put in this result?

Suppose there is a test for a rare cancer, present in 1% of the population. Suppose that the test for this cancer is 95% accurate and that you get a positive result. What is the probability that you actually have the cancer?

To make things simple, let us assume there are 1 million people, of whom 1%, ie 10,000 have the rare cancer, whereas the rest, ie 990,000, do not. So false positives will amount to 5% of 990,000 ie 49,500. Correct positive results will be 95% of 10,000, ie 9,500. So the chances that a person who receives a positive test result has the cancer is then 9,500/(9,500 + 49,995) = 9,500/59,495 = 0.16. This is about 1/6.

If the test is only 85% accurate, which is a more realistic value, then a positive result means the chance you actually have the cancer is 1,500/(1,500 + 148,500) = 1,500/150,000 = 1%.

This is sobering stuff.

Tad Boniecki
February, 2023