Solve COVID test validity using the Bayes theorem

bayes-theorembayesianprobability

The following information is given:

The COVID tests are $70\%$ sensitive, i.e., ${\Bbb P} ( \text{Positive} \mid \text{COVID} ) = 0.7$ and $98\%$ specific, i.e. Pr(negative|no Covid)=0.98. We need to solve the probability of having covid when the test result is covid given that a)P(Covid)=0.5 b) P(Covid)=0.05.

Can someone help me with making the joint probability distribution table and explain how they got it?

The work I've done so far is:
P(Covid|Positive) = P(Covid) x P(Positive|Covid) / P(Positive)
P(Covid|Positive) = 0.5 x (0.7) / (0.7 + 0.02)

I know the marginal probability is wrong but I don't think I understood the question fully. So having a table would help me understand it better.

Thanks in advance.

Best Answer

Your work so far looks good, but you're making a mistake in the denominator where you need to compute P(positive). I get:

$$\begin{align} P(\text{positive}) &= P(\text{positive | Covid}) P(\text{Covid}) + P(\text{positive | no Covid})P(\text{no Covid}) \\ &= (0.7) (0.5) + (0.02) (0.5) \\ &= 0.36. \end{align}$$ where the first line uses the Law of Total Probability. Another way to think about that line is: $P(\text{positive}) = P(\text{positive AND Covid}) + P(\text{positive AND no Covid})$.

Plugging that into your calculation, I get $$\begin{align} P(\text{Covid | positive}) &= \frac{P(\text{positive | Covid}) P(\text{Covid})}{P(\text{positive})} \\ &= \frac{(0.7)(0.5)}{0.36} \\ &= 0.97222 \end{align}$$

so in this scenario, $P(\text{Covid | positive})$ is very high! (Of course, things will look very different in the second scenario where you assume $P(\text{Covid}) = 0.05$...)


You asked about how to compute a joint probability distribution table. To do that, you should compute probabilities of combinations like this: $$P(\text{Covid AND negative}) = P(\text{negative | Covid}) P(\text{Covid}) = (0.3)(0.5)=0.15.$$ Then you could repeat that computation for other combinations of outcomes to build a full $2 \times 2$ table of probabilities.

Related Question