← Back to Simulations
Data: 10 patients treated in sequence, 8 cured — outcomes: cured, cured, not cured, cured, cured, not cured, cured, cured, cured, cured.

Updating belief, one patient at a time

The idea. Before seeing any patients, every cure rate θ from 0 to 1 is equally plausible — a flat prior. Each patient's result reweights that belief: a cure makes higher values of θ relatively more plausible, a non-cure makes lower values more plausible. Bayes' rule is just: multiply the current belief by how likely this result was under each θ, then rescale so it's a proper probability distribution again.

Sequential Bayesian updating

Step through the 10 patients

θ is discretized into a 100-point grid (0.01, 0.02, …, 1.00); the table below tracks 6 of those points, including the first and last.

\[ \color{#2e8b57}{\text{posterior}(\theta)} \;=\; \frac{\color{#555555}{p(\text{data} \mid \theta)} \cdot \color{#1f6feb}{\text{prior}(\theta)}}{p(\text{data})} \]

Is an 80% cure rate actually surprising?

The idea. Suppose the drug secretly did nothing, and the real background cure rate was just 35%. Simulate thousands of 10-patient trials at that rate and see how often chance alone produces a cure rate as high as the 80% we actually observed — that fraction is the p-value.

Null distribution of the cure rate

Null cure rate = 35%

Each trial simulates 10 patients at the null cure rate. Bars at or beyond the observed rate (θobs = 0.8) are the p-value's tail.

Reading the result: an 80% cure rate essentially never happens by chance alone at a 35% background rate — which is exactly why the sequential posterior above shifts so far to the right after only 10 patients.