Bayes Theorem with Data Analysis Example

In this class, We discuss Bayes Theorem with Data Analysis Example.

For Complete YouTube Video: Click Here

The reader should have prior knowledge of conditional probability. Click Here.

Bayes Theorem is also called Bayes rule. Bayes rule is a simple formula used to find conditional probability.

P(A|B) = (P(B|A) P(A))/P(B)

From conditional probability.

P(A|B) = P(A ∩ B) / P(B) —-1

P(B|A) = P(A ∩ B) / P(A) —- 2

P(A ∩ B) = P(B|A) P(A) from equation 2.

Substitute P(A ∩ B) in equation 1.

P(A | B) = (P(B|A) P(A))/P(B)

When we use the Bayes theorem?

With an example, we understand the use of the Bayes theorem.

To use the Bayes equation, we need the following probabilities.

P(A) and P(B) are prior probabilities.

P(B|A) likelihood probability, how likely B occurs given A.

P(A|B) posterior probability

Example:

In a hospital, from past collected data.

1) 10% of the patients entering the clinic have liver disease. P(A) = 0.1

2) 5% of the clinic’s patients are alcoholics. P(B) = 0.05

3) Among the liver disease patients, 7% are alcoholics. P(B | A) = 0.07

Find the probability of the patient being alcoholic and their chances of having liver disease.

P(A|B) = ?

P(A|B) = (P(B|A) P(A)) / P(B)

P(A|B) = (0.07 * 0.1)/0.05

P(A|B) = 0.14

14 percent chances to get liver disease