Got a Positive Covid Test Result? It might not mean what you think it does.

Ed note 8/12/20 11:30am:  Based on feedback from my readers here is an important clarification:  This blog post refers to a situation of an individual Covid-19 test case and what the inferences are regarding a positive result when the prevalence of infection is relatively small.  

Infection rates at the population level (e.g. state or nation level reporting) are:

  •  Based on an entirely different set of assumptions and are unaffected by the phenomenon reported herein.  
  • Press reports of Covid infections are likely under-reported by a factor of at least 6X - meaning if the press reports 5 million infections in the US the real number is probably greater than 30 million.  
  • In addition, I'd like to re-emphasize that if you get a positive test result you need to behave as if there is 100% chance that you have Covid-19 - and isolate for a 14 day period

You are asymptomatic and just got tested for Covid-19.  It came back positive.  What are your chances of actually having Covid?  

38.5%

i.e. there is a 61.5% chance you don't actually have it.  

This is assuming the Covid test is 98% accurate (regarding its specificity).  

How could a positive result from a 98% accurate test give a 38.5% probability of being infected? This goes against the grain of common sense.

There is actually nothing wrong with the test or the methodology.  It also has nothing to do with being asymptomatic and actually having the disease (this is a separate issue and has been widely reported).

This is just simple math and this is what we will explore in today's blog post.

Important note:  Despite the lower chance of having the infection that is described here, all positive test results should always be followed by at least 14 days of isolation and quarantine per the CDC's recommendations.

The Bayesian Approach

In a previous post, I introduced you to Thomas Bayes and his powerful three step process for reasoning his way through a problem.  

Thomas Bayes (/beɪz/; c. 1701 – 7 April 1761) was an English statistician, philosopher and Presbyterian minister who is known for formulating a specific case of the theorem that bears his name: Bayes' theorem (source: Wikipedia).

Here is a quick review of the three steps: 

#1: Carefully define what is called the prior before considering any new evidence:
  • The prior:  What kind of evidence do we currently have about Covid-19 (such as how common it is in the population)?
#2: Consider the new evidence, once we have the prior firmly in mind:
  • What new evidence is being presented (= the Covid test results) and how strong is that evidence (e.g. how accurate is the test)?
#3: Add the new evidence to our thinking and use it to determine what is called the posterior probability:
  • After factoring in both the strength of the prior and the confidence we have in the new evidence, what is the new probability (i.e. how probable is it that you have Covid given the prior and the new evidence)? 
Let's walk through each of these steps for our positive Covid-19 test results:

Defining the prior

The prior here is defined as the relevant information before we got our test.  The most important thing is what the prevalence of Covid-19 is in our local area, and we'll use that as our prior.  

(Note that a more complete prior would include whether you had any symptoms or had been exposed to anyone with the disease... for simplicity's sake we will just assume you are asymptomatic and hadn't been exposed to anyone with Covid.)

Determining the actual prevalence of the virus is not a straightforward calculation.  You can't measure it directly so it has to be inferred from things like antibody test results, # of cases and test positivity results.

Yougong Gu is a data scientist out in Washington State, and he is widely acknowledged as one of the best modelers of Covid around.  So instead of dragging you through my calculations, we will just use Gu's model for the state of Maryland:
  • Covid-19 prevalence in Maryland is estimated to be 1.37% (for August 11, 2020).
This means that, without any additional evidence, you have a 1.37% chance of having Covid.  We will use this figure for our prior.

New Evidence

The new evidence is our positive test result.  

Let's see how strong this evidence is.  For the PCR test used in the state of Maryland, here are the accuracy numbers:
  • False negative rates for PCR tests range between 2% and 29%.  This implies a sensitivity of between 71% and 98%.  We'll give the test the benefit of the doubt and use 90% as a sensitivity.
  • False positive rates for PCR tests range between 0 and 4%.  This implies a specificity of between 96% and 100%.  We will take the average of 98%.

Calculating the Posterior Probability

The Posterior Probability is the chance that you have Covid given the prior and the new evidence.  Let's walk through the logic here on how I came up with the admittedly non-intuitive result of 38.5%.  

(The mathematical explanation using Bayes' Theorem is in the appendix if you are interested in the details of the calculation.)

Figuring in our prior (active infections in MD are 1.37%) is the actual key to understanding the surprising result.  This indicates that the infection is actually pretty rare among the population.  
  • The test will catch 90% of the 1.37% infected (=1.23% of the population) - these are the true positives.
  • But the test will also report 2% of the remaining 98.63% (=1.97% of the population) that actually doesn't have Covid - these are the false positives.  
Because the infection is actually pretty rare, you can see from the above two statements that the false positives will be larger than the true positives (1.97% vs. 1.23% of the population).   Surprisingly, even though the test is 98% accurate, it is actually more likely you are a false positive than a true positive.

When you take this into consideration, it reduces the odds from 98% percent to 38.5% that you actually have Covid-19. 

Now what?

You've just figured out you have a 38.5% chance of having Covid-19 - assuming you are asymptomatic and haven't been exposed to others with Covid.  What should you do?  

I recommend that you get another test and go through the 3 Bayesian steps again!

The Second Test

You now have a Prior that says you are 38.5% likely to have the virus. 

If the New Evidence is that you test positive again (the second time), The updated Posterior Probability that you have the virus is 96.5% 

If the New Evidence is that you test negative on the second test (after testing positive on the first test), the updated Posterior Probability that you have the virus is 5.9%

(See the appendix for the second test math details.)

You can see that the second test will be definitive: 96.5% chance if you test positive and 5.9% chance if you test negative.  

So get the second test.

BTW you might be asking what the chances of having Covid-19 if the first test is negative.  That answer is 0.14% (see the last appendix for the math).  You can relax in that scenario (assuming the sample was taken correctly and it was a PCR test).

Appendix

The First Test

We will use Bayes' Theorem for the calculations:

P(cv | +) = P(+ | cv) x P(cv) / P(+)

Where: 
  • P(cv | +) = the probability of having Covid given a positive test result (this is the answer we are looking for)
  • P(+ | cv) = the probability of getting a positive test result given you have Covid (this is the sensitivity of the test) = 90%
  • P(cv) = the prior probability of having Covid (the prevalence of the infection) = 1.37%
  • P(+) = the probability of a positive test result (see below)
So, P(cv | +) = 0.9 x 0.0137 / P(+) = 0.01233 / P(+)

We now need to calculate the denominator P(+) - the probability of a positive test result.  To get this we need to sum the two ways that a positive test result can be achieved - true positives = P(+ | cv) x P(cv) and the false positives = P(+ | no cv) x P(no cv)

P(+) = P(+ | cv) x P (cv) + P(+ | no cv) x P(no cv) 

Where:
  • P(+ | no cv) = probability of getting a positive test result where there is no Covid (this is the false positive rate) = 1 - Specificity = 1 - 98% = 0.02
  • P(no cv) = probability of not having Covid = 1 - 1.37% = 0.9863
So, P(+) = 0.9 x 0.0137 + 0.02 x 0.9863 = 0.0320

And P(cv | +) = 0.01233 / 0.0320 = 38.5%

The Second Test (assume positive test result)

We will again use Bayes' Theorem for the calculations:

P(cv | +) = P(+ | cv) x P(cv) / P(+)

Where: 
  • P(cv | +) = the probability of having Covid given a second positive test result (this is the answer we are looking for)
  • P(+ | cv) = the probability of getting a positive test result given you have Covid (this is the sensitivity of the test) = 90%
  • P(cv) = the prior probability of having Covid (the posterior probability from the first test) = 37.5%
  • P(+) = the probability of a second positive test result (see below)
So, P(cv | +) = 0.9 x 0.375 / P(+) = 0.3375 / P(+)

We now need to calculate the denominator P(+) - the probability of a positive test result.  To get this we need to sum the two ways that a positive test result can be achieved - true positives = P(+ | cv) x P(cv) and the false positives = P(+ | no cv) x P(no cv)

P(+) = P(+ | cv) x P (cv) + P(+ | no cv) x P(no cv) 

Where:
  • P(+ | no cv) = probability of getting a positive test result where there is no Covid (this is the false positive rate) = 1 - Specificity = 1 - 98% = 0.02
  • P(no cv) = probability of not having Covid = 1 - 37.5% = 0.615
So, P(+) = 0.9 x 0.375 + 0.02 x 0.615 = .3497

And P(cv | +) = 0.3375/ 0.3497 = 96.5%

The Second Test (assume negative test result)

We will again use Bayes' Theorem for the calculations:

P(cv | -) = P(- | cv) x P(cv) / P(-)

Where: 
  • P(cv | -) = the probability of having Covid given a second negative test result (this is the answer we are looking for)
  • P(- | cv) = the probability of getting a negative test result given you have Covid (this is the false negative rate of the test) = 10%
  • P(cv) = the prior probability of having Covid (the posterior probability from the first test) = 37.5%
  • P(-) = the probability of a negative test result (see below)
So, P(cv | -) = 0.1 x 0.375 / P(-) = 0.0375 / P(-)

We now need to calculate the denominator P(-) - the probability of a negative test result.  To get this we need to sum the two ways that a negative test result can be achieved - true negatives = P(- | no cv) x P(no cv) and the false negatives = P(- | cv) x P(cv)

P(-) = P(- | no cv) x P (no cv) + P(- | cv) x P(cv) 

Where:
  • P(- | no cv) = probability of getting a negative test result where there is no Covid (this is the true negative rate) = Specificity = 98%
  • P(no cv) = probability of not having Covid = 1 - 37.5% = 0.615
So, P(-) = 0.98 x 0.615 + 0.1 x 0.375 = .6402

And P(cv | -) = 0.0375/ 0.6402 = 5.9%

Negative Results for the First Test

We will again use Bayes' Theorem for the calculations:

P(cv | -) = P(- | cv) x P(cv) / P(-)

Where: 
  • P(cv | -) = the probability of having Covid given a negative test result (this is the answer we are looking for)
  • P(- | cv) = the probability of getting a negative test result given you have Covid (this is the false negative rate of the test) = 10%
  • P(cv) = the prior probability of having Covid = 1.37%
  • P(-) = the probability of a negative test result (see below)
So, P(cv | -) = 0.1 x 0.0137 / P(-) = 0.00137 / P(-)

We now need to calculate the denominator P(-) - the probability of a negative test result.  To get this we need to sum the two ways that a negative test result can be achieved - true negatives = P(- | no cv) x P(no cv) and the false negatives = P(- | cv) x P(cv)

P(-) = P(- | no cv) x P (no cv) + P(- | cv) x P(cv) 

Where:
  • P(- | no cv) = probability of getting a negative test result where there is no Covid (this is the true negative rate) = Specificity = 98%
  • P(no cv) = probability of not having Covid = 1 - 1.37% = 0.9863
So, P(-) = 0.98 x 0.9863 + 0.1 x 0.0137 = .968

And P(cv | -) = 0.00137/ 0.968 = 0.14%












Comments

Popular posts from this blog

Will Tariffs Jack Up Your Bills and Push the World to the Brink?

America’s Ideological Dumpster Fire