Skip to main content

Bayes' Theorem

The Medical Testing Paradox & Conditional Probability

📚 Introduction

🏥 Medical Testing Paradox

假设有一种罕见疾病,患病率为1%。现在有一种检测方法,准确率高达99%(灵敏度99%,假阳性率5%)。 如果你的检测结果呈阳性,你真正患病的概率是多少?

Intuition says ~99%, but the real answer will surprise you...

📐 Bayes' Formula

P(A|B) = P(B|A) × P(A) / P(B)
Posterior = Likelihood × Prior / Marginal

🔑 Key Concepts

  • Prior P(A): Probability before new evidence (e.g., disease prevalence)
  • Likelihood P(B|A): Probability of evidence given event (e.g., sensitivity)
  • Posterior P(A|B): Probability of event after observing evidence
💡 Why is it counterintuitive?

当疾病很罕见时,即使检测很准确,假阳性的绝对数量也可能远超真阳性。 这就是为什么不建议对低风险人群进行大规模筛查的原因之一。

⚙️ Adjust Parameters

🎯 Bayesian Calculation

If you test positive, the probability of actually having the disease is
16.7%
Not the intuitive 99%
🤯 Surprised?

即使检测准确率很高,当疾病罕见时,阳性结果中大部分可能是假阳性! 这就是贝叶斯定理的威力——它告诉我们要考虑基础概率(先验)。

📊 Confusion Matrix

Actually Sick
Actually Healthy
Test Positive
True Positive
0.99%
False Positive
4.95%
Test Negative
False Negative
0.01%
True Negative
94.05%

👥 Population Visualization

Imagine 1000 people tested, see the distribution:

True Positive (10)
False Positive (50)
False Negative (0)
True Negative (940)
60
Total Positive
10
Actually Sick
50
False Alarm
16.7%
PPV