Login
📚 Online Statistics Education
Chapters ▾
⇩ Download ▾

5.13 Bayes Demo

This section is an interactive demonstration. The live simulation runs on the original site: open the demonstration at onlinestatbook.com.

Learning Objectives

  1. Learn how base rates can impact a conditional probability
  2. Calculate probabilities based on a tree diagram
  3. Calculate probabilities based on Bayes' theorem

Instructions
This demonstration lets you examine the effects of base rate, true positive rate, and false positive rate on the probability that a person diagnosed with disease X actually has the disease. The base rate is the proportion of people who have the disease. The true positive rate is the probability that a person with the disease will test positive. The false positive rate is the probability that someone who does not have the disease will test positive. The demonstration is based on 10,000 people being tested. A tree diagram showing the results and calculations based on Bayes' theorem are shown. They should always agree.

You can change the initial values and then press the "Calculate" button.

Illustrated Instructions
The Bayes' Theorem demonstration starts by displaying the results for the default base rate, true positive rate and the false positive rate as shown in the screenshot below. You can change any of these three numbers and click the "Calculate" button to get the results based on the changes you make.

Screenshot of the Demonstration of Bayes' Law page. Three editable inputs set the base rate (proportion with Disease X) to 0.02, the true positive rate to 0.99, and the false positive rate to 0.09, with a Calculate button. A tree diagram of expected frequencies for 10,000 people branches People: 10000 into Disease: 200 (Test Positive: 198, Test Negative: 2) and No Disease: 9800 (Test Positive: 882, Test Negative: 8918). The text below works it through: 198 + 882 = 1080 test positive, 198/1080 = 0.1833 of those testing positive have the disease. Bayes' theorem is then restated in symbols with each term glossed and the same four values substituted.

We recommend you answer the questions even if you have to guess. Then use the simulation to help you verify your answers.

You can change the base rate, true positive rate and false positive rate and calculate results for any changes you make.

Adapted from Online Statistics Education: A Multimedia Course of Study (onlinestatbook.com), Project Leader: David M. Lane, Rice University. Developed with NSF support. The original work is in the public domain; it is cited here at the authors' request. Changes were made: reformatted as an accessible XYZ web edition with native MathML. License: Public-Domain.