Bayesian Statistics — Basics

Updating Beliefs with Evidence

Learning Objectives

  1. Explain the Bayesian framework: prior, likelihood, and posterior
  2. Distinguish frequentist vs Bayesian inference
  3. Interpret posterior distributions and credible intervals
  4. Understand how prior choice affects conclusions
  5. Apply Bayesian thinking to clinical diagnosis
  6. Interpret Bayes factors as evidence for or against hypotheses
  7. Recognise when Bayesian methods offer advantages

Clinical Hook: Screening for OSA

A 48-year-old man: daytime sleepiness, loud snoring, morning headaches.

BLESS cohort (Pakhare, Joshi A, AIIMS Bhopal, 2024):

  • 1,015 adults with gold-standard polysomnography
  • 30.5% had moderate-severe OSA
  • This is your prior probability

. . .

You administer the SONA questionnaire (Joshi A, Goyal A, Pakhare A, 2025):

  • Sensitivity: 73%, Specificity: 78%
  • Patient scores positive

What is the probability he has OSA now?

This is Bayesian reasoning — updating a prior belief with new evidence.

The Bayesian Formula

\[P(\text{Disease} \mid \text{Test}^+) = \frac{P(\text{Test}^+ \mid \text{Disease}) \times P(\text{Disease})}{P(\text{Test}^+)}\]

In words: Posterior = (Likelihood × Prior) / Evidence

Component Meaning OSA Example
Prior Belief before test Prevalence = 30.5%
Likelihood P(data | hypothesis) Sensitivity = 73%
Evidence P(data overall) P(SONA+) = 37.5%
Posterior Updated belief 59.3%

The same positive test gives different answers depending on the prior. In a low-prevalence population (5%), the post-test probability would be only 14.9%.

Prior × Likelihood → Posterior

The posterior is ALWAYS a compromise. More data → posterior follows data. Less data → prior dominates.

Frequentist vs Bayesian

Frequentist Bayesian
Probability Long-run frequency Degree of belief
Parameters Fixed but unknown Random variables
Prior info Not formally used Explicitly incorporated
Result p-value, CI Posterior, credible interval
Interpretation “If repeated infinitely…” “Given the data…”

The p-value problem: p = 0.04 does NOT mean “4% chance the null is true.”

A 95% CI does NOT mean “95% probability the true value is in here.”

A 95% credible interval DOES mean exactly that.

Confidence Interval vs Credible Interval

Types of Priors

Uninformative = know nothing | Informative = prior studies | Strongly informative = large prior data

Who Wins: Prior or Data?

Bayes Factor — Evidence for or Against

\[BF_{10} = \frac{P(\text{Data} \mid H_1)}{P(\text{Data} \mid H_0)}\]

BF₁₀ Interpretation
< 1 Evidence favours null (H₀)
1–3 Anecdotal evidence for H₁
3–10 Moderate evidence for H₁
10–30 Strong evidence
> 100 Extreme evidence

Key advantage over p-values: A p-value can never support the null. A Bayes factor can.

BF₁₀ = 0.15 means BF₀₁ = 6.7 → moderate evidence for no treatment effect.

Diagnostic Reasoning Is Bayesian

Bayesian Updating in Practice

The Pralidoxime Story (Eddleston, Joshi R et al., PLoS Med 2009):

Being Bayesian means being willing to update — even when the data contradict your beliefs.

ROPE: Clinically Meaningful Decisions

Region of Practical Equivalence — is the effect big enough to matter?

  • 95% outside ROPE → clinically meaningful | 95% inside ROPE → practically null | Straddles → undecided

Identify the Approach — Vignette 1

A new rapid diagnostic test for TB has sensitivity 92% and specificity 88%. In a tribal district of MP, TB prevalence is 500 per 100,000 (0.5%). A patient with chronic cough tests positive.

What is the post-test probability of active TB?

Bayesian calculation: P(TB | Test+) = (0.92 × 0.005) / (0.92 × 0.005 + 0.12 × 0.995) = 3.7%

Even with a positive test, the probability is only ~3.7% because the prior is extremely low. The prior dominates when prevalence is very low. This is why mass screening for rare diseases generates many false positives.

Identify the Approach — Vignette 2

An RCT of a new antihypertensive (n = 40) finds mean SBP reduction of 6 mmHg (95% CI: −1 to 13, p = 0.09). A frequentist concludes “not significant.” A Bayesian analysis with an informative prior (from a related drug class showing 5 mmHg benefit) gives a posterior mean of 5.8 mmHg, 95% CrI [1.2, 10.4].

The Bayesian analysis borrows strength from prior knowledge and concludes there is a >97.5% probability of some benefit. The frequentist analysis, ignoring prior information, cannot reject the null. Both are valid approaches — but the Bayesian one incorporates more information and gives a more clinically useful answer for a small trial.

Identify the Approach — Vignette 3

A pharmaceutical company tests whether a generic drug is equivalent to the branded version. The RCT (n = 500) yields p = 0.42 for the difference. The company claims “no difference — the drugs are equivalent.”

A p-value cannot prove equivalence — it only fails to reject a difference. A Bayesian analysis with BF₁₀ = 0.08 (BF₀₁ = 12.5) would provide strong evidence for equivalence. The Bayes factor directly quantifies evidence for the null hypothesis, which is exactly what’s needed here.

Common Misconceptions

Warning

  1. “Bayesian = subjective = unreliable” → The prior is explicit and transparent; frequentist assumptions are hidden
  2. “You can choose any prior you want” → Sensitivity analysis tests robustness; reviewers check priors
  3. “Bayesian always disagrees with frequentist” → For large samples with weak priors, they converge
  4. “A flat prior = no assumptions” → Flat on [0,1] says all values equally likely — that IS an assumption
  5. “You need special software” → R (brms), Python (PyMC), JASP (free GUI) all support Bayesian
  6. “Too complicated for clinical research” → The concept (update beliefs with evidence) is simpler than p-value logic

Key Takeaways

  1. You’re already Bayesian — clinical diagnosis uses pre-test probability + LR = post-test probability
  2. Prior × Likelihood → Posterior — the posterior is a compromise
  3. With enough data, the prior barely matters — Bayesian and frequentist converge
  4. Credible intervals answer the question clinicians actually want
  5. Bayes factors can support the null — p-values cannot
  6. ROPE replaces “p < 0.05” with clinically meaningful decisions
  7. Always do sensitivity analysis — show results with alternative priors
  8. Being Bayesian = being willing to update — even when data contradict your beliefs