P(disease) 1.0%
How common is the condition in the population?
P(test+ | disease) 99.0%
Sensitivity: when sick, % the test correctly says so.
P(test− | healthy) 95.0%
Specificity: when healthy, % the test correctly says so.
Population shown 10,000
Larger = smoother visualization; same math regardless.
P(disease | test+) = [P(test+ | disease) × P(disease)] ÷ P(test+)
Likelihood ratios: LR⁺ = sensitivity ÷ (1 − specificity) = - LR⁻ = (1 − sensitivity) ÷ specificity = -
LR⁺ > 10 = strong positive evidence. LR⁻ < 0.1 = strong negative evidence. Multiply the prior odds by the LR to get posterior odds (the way doctors actually compute Bayes).
Run a second test: The posterior from the first test becomes the prior for the second. Watch P(sick) update twice.
Has disease (red) Healthy (green) Yellow ring = test + Blue ring = test −
If your test is POSITIVE, prob. you're actually sick:
-
If your test is NEGATIVE, prob. you're actually sick:
-
🌳 Show probability tree (alternative representation)
✨ Featured comparison
Featured comparison

Change the base rate before touching test accuracy. A strong test can still produce a surprising posterior when the condition is rare.

Run one scenario with a rare condition and one with a common condition, then compare posterior probability.

🧭 Visual explanation

Live state to watch
No state captured yet. Run or adjust the applet first.
Misread to avoid

📚 Lesson tour (5 steps)
Step 1/5: -

-

📝 Worksheet (3 questions)

Q1. Disease test. Set prior=1%, sensitivity=99%, specificity=99%. P(disease | positive) is closest to:

Q2. Hold sens=99%, spec=99%. Raise prior from 1% to 20%. P(disease | positive) goes:

Q3. Back to prior=1%, sens=99%, spec=99%. After ONE positive (posterior ≈ 50%), click "Test came back POSITIVE" to retest. After the SECOND positive, P(disease) is closest to:

🧪 Student response packet

Predict how a positive result changes belief, adjust the prior and test accuracy, then explain the base-rate effect.

State snapshot appears here.
♿ Text and keyboard support

Text and keyboard support

Keyboard path

  • Use Tab and Shift+Tab to move through controls.
  • Use Enter or Space on buttons, and arrow keys on sliders or select controls.
  • The visual region is focusable and described by the state summary below.

Text state summary

Reduced motion and non-visual support

Reduced-motion settings are honored where possible. The current state is also available as text, so the main result does not depend only on color, animation, or spatial position.

Accessibility note: this layer gives a text equivalent for the applet state. It does not replace a full human screen-reader audit.