Statistics 101
Random


Click random to get a fresh chapter.

Introductory Statistics: Probability - Bayes Theorem Prior Posterior Medical Testing Application




What Is This?

Bayes' Theorem is a mathematical formula used to update the probability of a hypothesis as more evidence or information becomes available. It's crucial for understanding how prior beliefs (priors) are updated to posterior beliefs (posteriors) based on new data. This topic appears in exams to test your ability to apply probabilistic reasoning in practical scenarios, such as medical testing.

Why It Matters

Bayes' Theorem is tested in various exams, including statistics, data science, and medical courses. It frequently appears in questions worth 10-20% of the total marks. This topic tests your analytical skills and your ability to integrate new information into existing knowledge.

Core Concepts

  1. Prior Probability: The initial probability of an event before new evidence is considered.
  2. Likelihood: The probability of observing the evidence given that the hypothesis is true.
  3. Posterior Probability: The updated probability of the hypothesis after considering the new evidence.
  4. Marginal Likelihood: The total probability of observing the evidence, considering all possible hypotheses.
  5. Conditional Probability: The probability of an event occurring given that another event has occurred.

Prerequisites

  1. Basic Probability: Understanding of probability rules and conditional probability.
  2. Set Theory: Knowledge of sets and their operations.
  3. Algebra: Basic algebraic manipulation skills.

The Rule-Book (How It Works)

Primary Rule

Bayes' Theorem is stated as:

[ P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)} ]

Where: - ( P(A|B) ) is the posterior probability of ( A ) given ( B ). - ( P(B|A) ) is the likelihood of ( B ) given ( A ). - ( P(A) ) is the prior probability of ( A ). - ( P(B) ) is the marginal likelihood of ( B ).

Sub-rules and Edge Cases

  • Marginal Likelihood Calculation: ( P(B) = P(B|A)P(A) + P(B|\neg A)P(\neg A) )
  • Independent Events: If ( A ) and ( B ) are independent, ( P(A|B) = P(A) ).

Visual Pattern

Think of Bayes' Theorem as a probability update machine:

[ \text{Posterior} = \frac{\text{Likelihood} \times \text{Prior}}{\text{Marginal Likelihood}} ]

Exam / Job / Audit Weighting

  • Frequency: Common
  • Difficulty Rating: Intermediate
  • Question Type: Multiple choice, short answer, problem-solving

Difficulty Level

Intermediate

Must-Know Rules, Formulas, Standards, or Principles

  1. Bayes' Theorem Formula: [ P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)} ]
  2. Marginal Likelihood Calculation: [ P(B) = P(B|A)P(A) + P(B|\neg A)P(\neg A) ]
  3. Conditional Probability: [ P(A|B) = \frac{P(A \cap B)}{P(B)} ]

Worked Examples (Step-by-Step)

Easy

Question: Suppose a disease has a prevalence of 1% in the population. A test for the disease has a sensitivity of 95% and a specificity of 90%. What is the probability that a person who tests positive actually has the disease?

Step-by-Step:
1. Identify Prior: ( P(D) = 0.01 )
2. Identify Likelihood: ( P(T|D) = 0.95 )
3. Identify False Positive Rate: ( P(T|\neg D) = 0.10 )
4. Calculate Marginal Likelihood: [ P(T) = P(T|D)P(D) + P(T|\neg D)P(\neg D) = 0.95 \times 0.01 + 0.10 \times 0.99 = 0.1085 ]
5. Apply Bayes' Theorem: [ P(D|T) = \frac{P(T|D) \cdot P(D)}{P(T)} = \frac{0.95 \times 0.01}{0.1085} \approx 0.0876 ]

Answer: The probability is approximately 8.76%.

Medium

Question: A factory produces light bulbs, and 5% of them are defective. A quality control test correctly identifies 98% of defective bulbs and 95% of non-defective bulbs. If a bulb is tested and found to be defective, what is the probability that it is actually defective?

Step-by-Step:
1. Identify Prior: ( P(D) = 0.05 )
2. Identify Likelihood: ( P(T|D) = 0.98 )
3. Identify False Positive Rate: ( P(T|\neg D) = 0.05 )
4. Calculate Marginal Likelihood: [ P(T) = P(T|D)P(D) + P(T|\neg D)P(\neg D) = 0.98 \times 0.05 + 0.05 \times 0.95 = 0.0965 ]
5. Apply Bayes' Theorem: [ P(D|T) = \frac{P(T|D) \cdot P(D)}{P(T)} = \frac{0.98 \times 0.05}{0.0965} \approx 0.518 ]

Answer: The probability is approximately 51.8%.

Hard

Question: A rare disease affects 0.1% of the population. A diagnostic test has a sensitivity of 99% and a specificity of 99.9%. If a person tests positive, what is the probability that they actually have the disease?

Step-by-Step:
1. Identify Prior: ( P(D) = 0.001 )
2. Identify Likelihood: ( P(T|D) = 0.99 )
3. Identify False Positive Rate: ( P(T|\neg D) = 0.001 )
4. Calculate Marginal Likelihood: [ P(T) = P(T|D)P(D) + P(T|\neg D)P(\neg D) = 0.99 \times 0.001 + 0.001 \times 0.999 = 0.00199 ]
5. Apply Bayes' Theorem: [ P(D|T) = \frac{P(T|D) \cdot P(D)}{P(T)} = \frac{0.99 \times 0.001}{0.00199} \approx 0.497 ]

Answer: The probability is approximately 49.7%.

Common Exam Traps & Mistakes

  1. Mistake: Confusing sensitivity and specificity.
  2. Wrong Answer: Using specificity as the likelihood.
  3. Correct Approach: Sensitivity is the likelihood of a positive test given the disease.

  4. Mistake: Ignoring the marginal likelihood.

  5. Wrong Answer: Dividing by the prior instead of the marginal likelihood.
  6. Correct Approach: Always calculate the marginal likelihood.

  7. Mistake: Not converting percentages to decimals.

  8. Wrong Answer: Using percentages directly in the formula.
  9. Correct Approach: Convert all percentages to decimals before calculation.

  10. Mistake: Misinterpreting the posterior probability.

  11. Wrong Answer: Assuming the posterior is the same as the prior.
  12. Correct Approach: Understand that the posterior updates the prior based on new evidence.

Shortcut Strategies & Exam Hacks

  1. Memory Aid: Remember the formula as "Posterior = (Likelihood × Prior) / Marginal Likelihood."
  2. Elimination Strategy: If the question involves independent events, the posterior equals the prior.
  3. Pattern Recognition: Look for keywords like "sensitivity," "specificity," and "prevalence" to identify the components of Bayes' Theorem.

Question-Type Taxonomy

  1. Multiple Choice: Direct application of Bayes' Theorem.
  2. Example: A disease has a prevalence of 2%. A test has a sensitivity of 90% and a specificity of 85%. What is the probability that a person who tests positive has the disease?
  3. Favored By: Statistics exams.

  4. Short Answer: Calculating posterior probabilities.

  5. Example: Given the sensitivity and specificity of a test, calculate the posterior probability of a disease given a positive test result.
  6. Favored By: Medical and data science exams.

  7. Problem-Solving: Applying Bayes' Theorem to real-world scenarios.

  8. Example: A factory produces items with a 3% defect rate. A quality control test has a 95% accuracy rate. What is the probability that a tested defective item is actually defective?
  9. Favored By: Engineering and quality control exams.

Practice Set (MCQs)

Question 1

Question: A disease affects 0.5% of the population. A test for the disease has a sensitivity of 98% and a specificity of 95%. If a person tests positive, what is the probability that they actually have the disease?

Options: A. 9.3% B. 18.6% C. 27.9% D. 37.2%

Correct Answer: A. 9.3%

Explanation: Use Bayes' Theorem to calculate the posterior probability. The low prevalence and high specificity result in a low posterior probability.

Why the Distractors Are Tempting: - B: Overestimates the impact of sensitivity. - C: Confuses sensitivity with specificity. - D: Ignores the marginal likelihood.

Question 2

Question: A quality control test for a product has a sensitivity of 99% and a specificity of 90%. If 1% of the products are defective, what is the probability that a product testing positive is actually defective?

Options: A. 9.0% B. 18.0% C. 27.0% D. 36.0%

Correct Answer: A. 9.0%

Explanation: Apply Bayes' Theorem with the given sensitivity, specificity, and prevalence to find the posterior probability.

Why the Distractors Are Tempting: - B: Overestimates the impact of specificity. - C: Confuses the roles of sensitivity and specificity. - D: Ignores the low prevalence rate.

Question 3

Question: A rare condition affects 0.01% of the population. A test for the condition has a sensitivity of 99.9% and a specificity of 99%. If a person tests positive, what is the probability that they actually have the condition?

Options: A. 0.9% B. 1.8% C. 2.7% D. 3.6%

Correct Answer: A. 0.9%

Explanation: Use Bayes' Theorem to calculate the posterior probability. The extremely low prevalence results in a very low posterior probability.

Why the Distractors Are Tempting: - B: Overestimates the impact of sensitivity. - C: Confuses sensitivity with specificity. - D: Ignores the marginal likelihood.

Question 4

Question: A diagnostic test for a disease has a sensitivity of 95% and a specificity of 98%. If the disease affects 2% of the population, what is the probability that a person who tests positive actually has the disease?

Options: A. 47.4% B. 57.4% C. 67.4% D. 77.4%

Correct Answer: A. 47.4%

Explanation: Apply Bayes' Theorem with the given sensitivity, specificity, and prevalence to find the posterior probability.

Why the Distractors Are Tempting: - B: Overestimates the impact of specificity. - C: Confuses the roles of sensitivity and specificity. - D: Ignores the prevalence rate.

Question 5

Question: A screening test for a condition has a sensitivity of 90% and a specificity of 95%. If the condition affects 5% of the population, what is the probability that a person who tests positive actually has the condition?

Options: A. 50.0% B. 60.0% C. 70.0% D. 80.0%

Correct Answer: A. 50.0%

Explanation: Use Bayes' Theorem to calculate the posterior probability. The moderate prevalence and high specificity result in a moderate posterior probability.

Why the Distractors Are Tempting: - B: Overestimates the impact of sensitivity. - C: Confuses sensitivity with specificity. - D: Ignores the marginal likelihood.

30-Second Cheat Sheet

  • Bayes' Theorem Formula: ( P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)} )
  • Marginal Likelihood: ( P(B) = P(B|A)P(A) + P(B|\neg A)P(\neg A) )
  • Sensitivity: Likelihood of a positive test given the disease.
  • Specificity: Likelihood of a negative test given no disease.
  • Prior Probability: Initial probability before new evidence.
  • Posterior Probability: Updated probability after new evidence.
  • Conditional Probability: Probability of an event given another event.

Learning Path

  1. Beginner Foundation:
  2. Review basic probability and conditional probability.
  3. Understand the concepts of sensitivity and specificity.

  4. Core Rules:

  5. Memorize Bayes' Theorem formula.
  6. Practice calculating marginal likelihood.

  7. Practice:

  8. Solve simple problems to apply Bayes' Theorem.
  9. Gradually increase the complexity of problems.

  10. Timed Drills:

  11. Practice solving problems under exam conditions.
  12. Focus on speed and accuracy.

  13. Mock Tests:

  14. Take full-length practice exams.
  15. Review and correct mistakes.

Related Topics

  1. Conditional Probability: Understanding the basics of conditional probability is essential for applying Bayes' Theorem.
  2. Sensitivity and Specificity: These concepts are crucial for medical testing applications of Bayes' Theorem.
  3. Probability Distributions: Knowledge of probability distributions helps in understanding the broader context of Bayes' Theorem.