Objectives
Explain the formula, show each numerical step, and state its assumptions.
Mathematical reasoning
P(A|B)=P(A∩B)/P(B), for P(B)>0, is the chance of A conditional on B. P(positive|event) and P(event|positive) refer to different denominators.
Bayes' rule updates the prior P(H) with new evidence: P(H|+)=P(+|H)P(H)/[P(+|H)P(H)+P(+|not H)P(not H)].
For rare events, high sensitivity need not imply high positive predictive value. This is a feature of a fictional screening model, not diagnostic advice.
Key formula
P(H|+) = Se×Prev / [Se×Prev + (1−Sp)×(1−Prev)]
Worked example: step by step
- Assume fictional prevalence 1%, sensitivity 90%, specificity 95%.
- Of 10,000 people, 100 have the event; 90 true positives. Among 9,900 without it, 5%=495 false positives.
- There are 585 positive results, so P(event|positive)=90/585≈15.38%.
Independent exercises
- Calculate P(H|+) for prior 0.2, sensitivity 0.8, false-positive rate 0.1.
- If 20 of 500 people have an event, what is prevalence?
- Does P(A|B)=0.6 alone determine P(B|A)?
Optional base R check
prev <- 0.01; se <- 0.90; sp <- 0.95
ppv <- se*prev/(se*prev+(1-sp)*(1-prev))
ppv
# Fictional rates. Not a real medical test.