01 / 20

Conditional Probability
& Screening Tests

Learn how to compute \( P(A \mid B) \), apply Bayes' Theorem, and interpret real-world screening results with confidence.

Business Statistics

What Is Conditional Probability?

Conditional probability measures the likelihood of event \( A \) occurring given that event \( B \) has already occurred. We write it as \( P(A \mid B) \) and read it as "the probability of \( A \) given \( B \)."

The denominator \( P(B) \) restricts our "universe" to only those outcomes where \( B \) is true. The numerator counts outcomes where both \( A \) and \( B \) happen.

Visualising \( P(A \mid B) \)

Sample Space S B A A ∩ B Given B occurred, what fraction is also A?

Why Screening Tests Matter

Businesses and healthcare systems use screening tests to make quick decisions: Is this transaction fraudulent? Does this patient have a disease? The test says positive or negative, but no test is perfect.

Sensitivity
\( P(\text{+} \mid \text{Disease}) \): the chance a truly sick person tests positive.
Specificity
\( P(\text{-} \mid \text{No Disease}) \): the chance a truly healthy person tests negative.
Prevalence
\( P(\text{Disease}) \): how common the condition is in the population.

Don't Confuse These Two

Sensitivity Positive Predictive Value
Symbol \( P(+ \mid D) \) \( P(D \mid +) \)
Question If truly sick, will the test catch it? If the test is positive, am I really sick?
Known Disease status is known Test result is known
Depends on prevalence? No Yes, heavily

Bayes' Theorem: The Bridge

The denominator is the total probability of testing positive, which includes true positives and false positives. This is the Law of Total Probability:

The Probability Tree

Start P(D) Disease P(+|D) True Pos (TP) P(-|D) False Neg (FN)
\( P(D^c) \)
Healthy
\( P(+\mid D^c) \)
False Pos (FP)
\( P(-\mid D^c) \)
True Neg (TN)

Step-by-Step Approach

1
Identify the three inputs: prevalence \( P(D) \), sensitivity \( P(+ \mid D) \), and specificity \( P(- \mid D^c) \).
2
Compute complements: \( P(D^c) = 1 - P(D) \) and false positive rate \( P(+ \mid D^c) = 1 - \text{specificity} \).
3
Find total positives: \( P(+) = P(+ \mid D)\,P(D) + P(+ \mid D^c)\,P(D^c) \).
4
Apply Bayes' Theorem: \( P(D \mid +) = \dfrac{P(+ \mid D)\,P(D)}{P(+)} \).
5
Interpret the result in context: does a positive test really mean the condition is likely?

Example 1: Rare Disease

A disease affects 1% of the population. A screening test has sensitivity = 95% and specificity = 90%. If a person tests positive, what is \( P(D \mid +) \)?

Surprise: Only 8.8%?

Even with a "good" test (95% sensitivity, 90% specificity), a positive result means only about a 1-in-11 chance of truly having the disease. Why? Because the disease is rare: the 10% false positive rate generates many more false alarms than the 1% prevalence generates true cases.

TP 9.5 FP 99 Per 1,000 people tested

Example 2: Fraud Detection

A bank's algorithm flags 2% fraud prevalence. It catches 98% of true fraud (sensitivity) and correctly clears 95% of legitimate transactions (specificity). What is \( P(\text{Fraud} \mid \text{Flagged}) \)?

Example 3: High Prevalence Changes Everything

Same test (sensitivity 95%, specificity 90%) but now prevalence is 20%. Recalculate \( P(D \mid +) \).

The 2 x 2 Contingency Table

Disease (D) No Disease (\( D^c \)) Total
Test + TP FP TP + FP
Test - FN TN FN + TN
Total TP + FN FP + TN N

Common Mistakes

✕ Swapping Conditions
Treating \( P(+ \mid D) \) as if it equals \( P(D \mid +) \). These are fundamentally different unless prevalence = 50%.
✕ Ignoring Prevalence
Assuming a "99% accurate" test means a positive is 99% reliable. Low prevalence can make PPV shockingly low.
✕ Wrong Complement
Using \( 1 - \text{sensitivity} \) when you need the false positive rate. FPR = \( 1 - \text{specificity} \), not \( 1 - \text{sensitivity} \).

Summary of Key Metrics

Metric Formula Meaning
Sensitivity \( \frac{TP}{TP+FN} \) Catch rate for true cases
Specificity \( \frac{TN}{FP+TN} \) Clear rate for non-cases
PPV \( \frac{TP}{TP+FP} \) Reliability of a positive result
NPV \( \frac{TN}{FN+TN} \) Reliability of a negative result
FPR \( \frac{FP}{FP+TN} \) False alarm rate

Question 1 of 5

A disease has prevalence 5%. A test has sensitivity 90% and specificity 80%. What is \( P(+) \), the total probability of testing positive?

Question 2 of 5

Using the same test (sensitivity 90%, specificity 80%, prevalence 5%), what is \( P(D \mid +) \)?

Question 3 of 5

Which factor has the greatest impact on Positive Predictive Value when sensitivity and specificity are held constant?

Question 4 of 5

In a population of 10,000 with 3% disease prevalence, sensitivity = 95%, specificity = 92%. How many false positives are expected?

Question 5 of 5

A company's drug test has specificity 99% and sensitivity 99%. Drug use prevalence is 0.5%. An employee tests positive. What is the approximate \( P(\text{User} \mid +) \)?