Bayes' theorem as a tree
A person is tested for a disease. Change the prevalence, the sensitivity and the specificity. The tree, the branch thickness and the result follow immediately.
Prior: how common is the disease?
Likelihood: positive test if diseased
Negative test if healthy (false positive rate = 1 − specificity)
Examples:
P(Dpos | Tpos), posterior
Diseased, given a positive test
P(Tpos), evidence
Share of all people with a positive test
P(Dpos | Tneg)
Diseased, given a negative test
Reading the tree: the first split is the prior (prevalence), the second split holds the likelihoods (sensitivity and 1 − specificity). The two highlighted leaves are the people with a positive test. The posterior is the share of true positives among them. Thicker branches mean higher probability.