We test N people. Each person is positive with probability p, the prevalence. The data are one number: x positive out of N tested.
The bars show how probable each possible survey result is.
Example dataset. A real survey result, made from a secret value of p. Load it, then move the slider to see which values of p could have made it.
The likelihood of a candidate p is the probability of getting exactly this result if p were true.
Set a true prevalence p₀. Each simulated study runs a survey from p₀, finds its best estimate p̂, and measures how much better p̂ fits than the truth:
S = 2 × [log L(p̂) − log L(p₀)]
Drag the green line up and down the chart (or use the slider). Every value of p where the curve is above the line is in the interval. The lower the line, the wider the interval, and the more often it catches the truth. On the log scale the line sits a drop below the top; on the likelihood scale it sits at a % of the peak.