10 - Bayes’ Theorem Continued

Alex John Quijano

11/03/2021

Previously on Bayes’ Theorem…

Take-home Message

Today, we will:

Bayes’ Theorem

Image Source: ["Bayes’ rule with a simple and practical example" by Tirthajyoti Sarkar](https://towardsdatascience.com/bayes-rule-with-a-simple-and-practical-example-2bce3d0f4ad0){target=_blank}

Image Source: “Bayes’ rule with a simple and practical example” by Tirthajyoti Sarkar

15.15-Minute Activity (1/2)

Suppose that two jars contain colored balls as described in the table below.

Red White
Jar 1 3 3
Jar 2 4 2
  1. One jar is chosen at random and a single ball is selected. If the ball is white, what is the probability that it came from the 1st jar? Explain Why.
  2. One jar is chosen at random and two balls are selected. If both balls are red, what is the probability it came from the 2nd jar? Explain why.
  3. One jar is chosen at random and three balls are selected. If two balls are red and one is white, what is the probability it came from the 2nd jar? Explain why.
15:15

15.15-Minute Activity (2/2)

For a more detailed solution see this pdf notes.

COVID Testing Accuracy

Example: There is no test that is 100% accurate in detecting COVID. Suppose that there is a 95% percent accuracy in detecting COVID infections.

What does accuracy mean?

Useful terms:

Accuracy vs Precision

positive test
\(+\)
negative test
\(-\)
COVID
\(C^+\)
true positives (tp) false negative (fn)
type II error
true positive rate
(sensitivity)
\(\frac{tp}{tp+fn}\)
No COVID
\(C^-\)
false positive (fp)
type I error
true negative (tn) true negative rate
(specificity)
\(\frac{tn}{tn+fp}\)
positive predicted value
(precision)
\(\frac{tp}{(tp+fp)}\)
negative predicted value
\(\frac{tn}{tn+fn}\)
accuracy
\(\frac{tp+tn}{tp+tn+fp+fn}\)

100,000 Patients Example

Suppose that we have \(100,000\) patients with \(1000\) patients are infected and \(99,000\) patients are not, and below shows how many of them tested positive and tested negative. Given this example, the probability of having actual COVID is 1% (which is also known as the prevalence rate).

positive test
\(+\)
negative test
\(-\)
COVID
\(C^+\)
950 50 \(\text{sensitivity} = \frac{950}{1000} = 0.95\)
No COVID
\(C^-\)
4950 94050 \(\text{specificity} = \frac{94050}{99000} = 0.95\)
\(\text{precision} = \frac{950}{950+4950} = 0.1610\) \(\text{accuracy} = \frac{950+94050}{100,000} = \mathbf{0.95}\)

Sensitivity and Specificity

Summary

Today, we discussed the following:

Next, we will discuss: