Bayes’ Theorem is applied to medical tests, to calculate the probability of being infected with a virus, given a positive or negative test result. What drives the uncertainty is false negative results, or false positive results. In this article, I give a practical outline as to how one can interpret one’s test result, after calculating the relevant probability using Bayes’ Theorem.

To start off with, we need two estimates. For a negative covid-19 test, we need the rate of false negative results, and the current actual prevalence of the disease in the community. On the other hand, for a positive covid-19 test, we need the rate of false positives, and the current prevalence of the disease. False outcomes in tests vary according to the laboratory doing the test, and probably also the skill with which each individual test is carried out, but, for the sake of a rational understanding of the usefulness of these tests, we can use common statistics to calculate feasible probabilities.

Let’s start off with a negative result. We can use a false negative rate of 20%, a fairly conservative estimate based on Kucirka, Lauer and Laeyendecker (2020) and Arevalo-Rodriguez, et al. (2020). The current actual prevalence of covid-19 in the community would be the number of people currently infected with the disease. Note that many people go untested (for example, due to being asymptomatic). Serosurveys (testing blood samples from a random sample of the population) have shown that covid-19 is more than ten times as prevalent as the number of confirmed cases tests have shown. Given that South Africa is in the middle of a second wave now, due to the novel 501.V2 mutation, one could conservatively use a current prevalence rate of about 1% (a higher prevalence rate would result in a higher probability of tests being accurate).

Denote a “negative test” as N, and a person having covid-19 as “C”, so that P(C|N) means “the probability of having covid-19, given that the test result is negative”, and P(N|C) = 0.2 means “the probability of getting a negative test result, given that the person has covid-19”. Bayes’ Theorem then is expressed as follows:

\begin{minipage}{8cm} \begin{align*} P(C|N) &= \frac{P(N|C)\cdot P(C)}{P(N|C)\cdot P(C) + P(N|\neg C)\cdot P(\neg C)} \\ &=\frac{0.2\cdot 0.01}{0.2\cdot 0.01 + 0.8\cdot 0.99}\\ &\approx 0.25\% \\ & \end{align*} \end{minipage}

The parameters we used show that a person has only a 0.25% chance of having covid-19, if their test result is negative.

What about a positive test result? Surkova, Nikolayevskyy and Drobniewski (2020) mention a false positive rate of about 2%. Using Bayes’ Theorem again, the probability of having covid-19, given a positive test result, could be:

\begin{minipage}{8cm} \begin{align*} P(C|P) &= \frac{P(P|C)\cdot P(C)}{P(P|C)\cdot P(C) + P(P|\neg C)\cdot P(\neg C)} \\ &=\frac{0.98\cdot 0.01}{0.98\cdot 0.01 + 0.02\cdot 0.99}\\ &\approx 33\% \\ & \end{align*} \end{minipage}

33% may seem like a pretty low probability of having covid-19, given a positive test result. This is mainly due to the very low actual prevalence of covid-19 in the community (1%), as the test result has some degree of error. If one took two covid-19 tests at the same time, then one would be able to update this probability with the second test result, a process known as posterior Bayesian inference. Since people usually don’t take two different tests at the same time in reality, this process cannot be used in reality, with covid-19 tests (as, a significant delay for the second test would result in a far lower presence of the virus in the body, after the immune response has targeted it). However, in theory, the calculation would be as follows, with the probability P(C)=33% of having covid-19 being the updated statistic.

\begin{minipage}{8cm} \begin{align*} P(C|P) &= \frac{P(P|C)\cdot P(C)}{P(P|C)\cdot P(C) + P(P|\neg C)\cdot P(\neg C)} \\ &=\frac{0.98\cdot 0.33}{0.98\cdot 0.33 + 0.02\cdot 0.66}\\ &\approx 96\% \\ & \end{align*} \end{minipage}

If the second test were positive as well, then the person would be much more certain that they have covid-19.

In conclusion, covid-19 tests provide an accurate way of telling if you do not have the disease. The positive test result gives a relatively low probability that you actually have the disease (given that the disease has such a low current prevalence in the community). A positive test result for a disease that has a longer life-span, or for a test with more accuracy, would give a better match between the result and the probability of the result being accurate. The rational interpretation that this article gives is useful to bear in mind, but it is still good practice to adhere to the precautions designed to slow the spread of the covid-19 pandemic, regardless of one’s knowledge of potential covid-19 infection in oneself and others around oneself. That is, keep your social bubble small; avoid crowded environments, close-contact or indoor spaces; wear a mask around friends and in public; and don’t shake hands. ?

How clear is this post?