# Covid-19 Testing and Conditional Probability

My first question on here, so please be kind :)

I'm trying to understand the correct answer for an assignment question that has already been submitted, related to Covid-19 and Conditional Probability, but I'm having trouble understanding why the answer is correct. I'd really appreciate any help because I have been trying to understand the question for a week now, and I'm still not getting it.

The probabilities that are known are:

                    / \
/   \
P(C)=0.003 /     \
/       \
Covid-19  no Covid-19
/ \         / \
P(+|C)=0.999 /   \       /   \ P(-|!C) = 0.98
/     \     /     \
+       -   +       -


$$P({C}) = 0.003$$, where $${C}$$ is the probability of a person having Covid-19.

$$P(-|\bar{C})= 0.98$$, where $$-$$ is the probability of testing negative. ie "the test is negative if the patient doesn't have CoVid19"

$$P(+|{C})=0.999$$, where $$+$$ is the probability of testing positive. ie "correctly identifies people with CoVid19 in 99.9% of all times"

From this, we are asked to calculate the probability of "having a positive test result when not being infected with Covid19":

$$P(+|\bar{C}) = 1 - P({C}) * 1 -$$P(-|\bar{C}) = 0.01994\$

Intuitively, this seems reasonable (and I've been told is correct).

We are then asked to find the probability of

"Actually not being infected with CoVid19 despite the test being positive".

I'm told that the answer to this is

$$P(\bar{C})|-) = 0.869$$.

Whilst I understand the maths, what I'm having trouble with is interpretation of the question.

To me, it seems that asking for the probability of

Actually not being infected with CoVid19 despite the test being positive

and the probability of

Having a positive test result when not being infected with Covid19

Can someone please help me understand how these are two different questions from a conditional probability perspective? ie how one corresponds to finding $$P(+|\bar{C})$$ and how one corresponds to $$P(\bar{C})|-)$$. Intuitively, it feels like both questions are asking for the false positive rate.

Thanks!

• I believe you can find all the answers you need in this thread stats.stackexchange.com/questions/185817/… , does it answer your question? – Tim May 7 '20 at 10:28
• Thanks so much for the reply. That's a really interesting thread, and I believe I understand the difference in P(A|B) vs P(B|A) in this context. I'm just not sure how "Actually not being infected with CoVid19 despite the test being positive" corresponds to asking for P(A|B) and "Having a positive test result when not being infected with Covid19" corresponds to P(B|A). To me, both questions are asking the same thing, and I'm trying to work out how I can deconstruct those sentences to know whether they are asking P(+|!C) or P(!C|+). Thanks so much! – int19h May 7 '20 at 11:12
• Okay, I think I have an idea as to why I'm finding this question challenging. The two questions posed don't make it clear what information is being given when assessing the probability. For example, asking "Actually not being infected with Covid19 despite the test being positive" doesn't make it clear to me whether the probability should be calculated based on "actually not being infected" being the given piece of information, or "the test not being positive" being the given piece of information. Does that make sense? – int19h May 7 '20 at 11:29
• Language is ambiguous, so it can be sometimes hard, but you can always try translating the sentence by adding | in the middle, so "not being infected with CoVid19 despite the test being positive" translates to P(not being infected | the test being positive), in many cases for homework assignments this would work, if not, think why it doesn't make sense and what does it tell you? – Tim May 7 '20 at 11:30

To answer to the question "What is the probability of not being infected with CoVid19 (a condition I define as 𝐶=0) despite the test being positive (T=1)", you should resort to the laws of conditional probabilities, which yield the so-called Bayes' theorem:

$$𝑃r(𝐶=0|T=1) = \frac{𝑃(T=1|𝐶=0) \times 𝑃(𝐶=0)}{ 𝑃(T=1) }$$

with $$Pr(T=1|𝐶=0)=1-0.98=0.02$$ being the probability of the test being positive knowing not being infected, $$Pr(𝐶=0)=0.997$$ the probability of persons not being infected (irrespective of the result of their test). On the denominator, $$Pr(T=1)$$ is the probability of the test being positive, akka the total probability: $$Pr(T=1) = Pr(T=1|𝐶=0) \times Pr(𝐶=0) + Pr(T=1|𝐶=1) \times Pr(𝐶=1) \\ = 0.02 * .997 + 0.999*.003 = 0.022937$$ that is, $$𝑃(𝐶=0|T=1) = 0.02 * .997 / 0.022937 \\ = 0.869$$

Hope this helps!

                                 / \
/   \
/     \
/       \
/         \
/           \
/             \
/               \
/                 \
/                   \
/                     \
P(C)=0.003 /                       \  P(!C)=0.997
/                         \
/                           \
/                             \
/                               \
/                                 \
Covid-19                            no Covid-19
/ \                                   / \
P(+|C)=0.999 /   \ P(-|C)=0.001     P(+|!C) = 0.02 /   \ P(-|!C) = 0.98
/     \                               /     \
+       -                             +       -
0.002997   0.000003                    0.01994   0.97706


From this, we are asked to calculate the probability of "having a positive test result when not being infected with Covid19"

This should be $$\begin{array}{} P(+|!C) &= & 1-P(-|!C)\\ &=& 1-0.98\\ &=& 0.02 \end{array}$$

What you computed is "having a positive test result and not being infected with Covid19"

the probability of Actually not being infected with CoVid19 despite the test being positive

This is a bit ambiguous question. This paragraph/comment is a bit pedantic. But at the same time it is not uncommon to see this being misinterpreted more often in different settings. So that is why I stress it. The same type of ambiguity/misinterpretation occurs when people consider the p-value or $$\alpha$$ level as the probability that 'type I' occur. That is not correct. The $$\alpha$$ level is the probability that a type I error occurs if the null hypothesis is right.

You have the following two situations:

• The probability to have no covid-19 and having a positive test result.

This is $$0.997*0.02 = 0.01994$$

• The probability to have no covid-19 conditional on having a positive test result.

That means, if you have a positive test result (0.01994 + 0.002997 = 0.022937 people have a positive test result) what is the probability of having Covid-19. Out of the 0.022937 people with a positive test result, 0.01994 have no Covid-19, this is a fraction of $$0.01994/0.022937 \approx 86.9\%$$ and that is the probability to not be infected if you have a positive test result.

So the probability of a false positive is 1.994% and the probability of a false positive among the positives is 86.9%.

You avoid confusion by remembering that conditionality is the fact, i.e. what we actually observe/know, what comes first. Then, when asking a question, you simply need to make it clear to yourself what the actual fact is and what the test is. The fact is the condition (after the "|"), the test (before the "|") is (the probability of) what we want to find out, given the fact. (Don't confuse medical test with statistical test. I am referring here to the latter.)

The terms false positive and false negative apply only conditioned on the truth, i.e. on the infection, not on the medical test.

Question 1: "Actually not being infected with CoVid19 despite the test being positive". Fact: test is positive, i.e. $$+$$. Test: not infected, i.e. $$\bar{C}$$. Hence we are looking for $$P(\bar C|+)$$. Here we do not know if the person is infected. We only know that the test was positive. This is not the probability of a false positive, since we don't know the actual truth (infected or not).
Question 2: "Having a positive test result when not being infected with Covid19". Fact: not infected, i.e. $$\bar C$$. Test: positive, i.e. $$+$$. Hence we are looking for $$P(+|\bar C)$$. Here we know that the person is not infected. We do not know if the person is tested positive or not. The test could be wrong. This is the probability of a false positive, since we know the actual truth (not infected).
Extra content: So, since Question 2 is the false positive rate, why is Question 1 interesting? Because Question 2, i.e. $$P(+|\bar C)$$ can be calculated in a clinical setting (controlled experiment), where people are tested (using a quicker, but not perfect test) who we know are not infected (for example by using a perfect but much more slower test). So, calculating the false negative rate (testing people given they are not infected) is easy. This is of interest from a pharmacological view, i.e. how effective is our test?
However, from the perspective of a patient, they don't know if they are actually infected if the (quick) test was positive, so they will be interested in Question 1 $$P(\bar C|+)$$ (having the disease given that they tested positive). Question 1 is not directly calculable, like Quesion 2 was: it doesn't make sense to randomly test people first, regardless of their disease (to first assert the condition, remember we said the condition is the fact) and then test them again using a better test. So Question 1 is calculated from Question 2 using Bayes' theorem (that is how they relate, see the answer of @RoroLaTulipe), hence its importance.