Bayes theorem application

Bayes theorem application

Published January 10, 2026

Bayes theorem application

On this page

Diagnostic Accuracy - The 2x2 Tango

Diagnostic Test Accuracy 2x2 Table and Metrics

Disease +Disease -
Test +True Positive (TP)False Positive (FP)
Test -False Negative (FN)True Negative (TN)
-   $Sensitivity = TP / (TP + FN)$
  • Specificity: Probability of testing negative if you don't have the disease. Rules IN.
    • $Specificity = TN / (TN + FP)$
  • Positive Predictive Value (PPV): Probability of having the disease if you test positive.
    • $PPV = TP / (TP + FP)$
  • Negative Predictive Value (NPV): Probability of not having the disease if you test negative.
    • $NPV = TN / (TN + FN)$

📌 SPIN & SNOUT: SPecific test, when Positive, rules IN. SNensitive test, when Negative, rules OUT.

⭐ Increasing disease prevalence increases PPV and decreases NPV. Sensitivity and specificity are intrinsic test characteristics and are unaffected by prevalence.

Prevalence's Power - The PPV/NPV Pivot

  • Prevalence = Pre-test Probability: The baseline chance of having a disease in a specific population before testing.

  • This directly influences the post-test probabilities (PPV and NPV).

  • High Prevalence Setting (e.g., specialist clinic):

      • PPV : A positive test is more trustworthy.
      • NPV : A negative test is less reliable.
  • Low Prevalence Setting (e.g., general screening):

      • PPV : More false positives are expected.
      • NPV : A negative test is very reassuring.

⭐ A positive screening test for a rare disease in the general population has a low PPV. Always confirm with a more specific test before diagnosing.

Prevalence, PPV, and NPV relationship with cut-off

Bayesian Logic - The Probability Update

Bayes' theorem updates pre-test probability to post-test probability based on a test result. This is done by converting probabilities to odds, applying a likelihood ratio, and then converting back.

  • Pre-test Odds: Odds of disease before testing.
    • $Pre-test odds = Prevalence / (1 - Prevalence)$
  • Likelihood Ratio (LR): The power of a test to change our certainty.
    • For a positive test: $LR+ = Sensitivity / (1 - Specificity)$
    • For a negative test: $LR- = (1 - Sensitivity) / Specificity$
  • Bayesian Update: The core calculation.
    • $Post-test odds = Pre-test odds × Likelihood Ratio$

⭐ A truly useful diagnostic test has an LR+ > 10 or an LR- < 0.1. These values cause large shifts in post-test probability, often confirming or ruling out a diagnosis.

image

  • Pre-test probability (often prevalence) is the crucial starting point before applying a diagnostic test.
  • Positive Predictive Value (PPV) is directly proportional to prevalence; as disease prevalence , PPV .
  • Negative Predictive Value (NPV) is inversely proportional to prevalence; as disease prevalence , NPV .
  • Sensitivity and Specificity are intrinsic test characteristics and are not affected by disease prevalence.
  • A high-Sensitivity test, when negative, effectively rules out disease (SNOUT).
  • A high-Specificity test, when positive, helps rule in disease (SPIN).

Practice Questions: Bayes theorem application

Test your understanding with these related questions

A scientist in Chicago is studying a new blood test to detect Ab to EBV with increased sensitivity and specificity. So far, her best attempt at creating such an exam reached 82% sensitivity and 88% specificity. She is hoping to increase these numbers by at least 2 percent for each value. After several years of work, she believes that she has actually managed to reach a sensitivity and specificity much greater than what she had originally hoped for. She travels to China to begin testing her newest blood test. She finds 2,000 patients who are willing to participate in her study. Of the 2,000 patients, 1,200 of them are known to be infected with EBV. The scientist tests these 1,200 patients' blood and finds that only 120 of them tested negative with her new exam. Of the patients who are known to be EBV-free, only 20 of them tested positive. Given these results, which of the following correlates with the exam's specificity?

1 of 5

Flashcards: Bayes theorem application

1/9

One Card to Rule Them _____

TAP TO REVEAL ANSWER

One Card to Rule Them _____

All

browseSpaceflip

Enjoying this lesson?

Get full access to all lessons, practice questions, and more.

Start Your Free Trial