skills/experimental-design/references/sequential_and_adaptive.md
A fixed design commits to a single sample size and one analysis at the end. Sequential and adaptive designs allow looks at the data during the study and let you stop early (for benefit, harm, or futility) or modify the design — saving participants, time, and money. The catch: every interim look at the data is another chance to cross the significance threshold by luck, so the error rate must be controlled explicitly. Peeking at accumulating data and stopping the first time p < 0.05 inflates the Type I error rate badly (to ~0.20+ with a few looks) — this is the core problem these methods solve.
If you test at α = 0.05 at each of K interim analyses and stop at the first significant result, the overall false-positive rate is far above 0.05 — roughly 0.08 for 2 looks, ~0.14 for 5, ~0.20 for 10. The fix is to spend your total α across the looks so the cumulative Type I error stays at 0.05.
Pre-plan a fixed number of interim analyses (e.g. after 25%, 50%, 75%, 100% of data) and use adjusted, more stringent boundaries at each look so the overall α is preserved. Common boundary families:
You can stop for:
Group-sequential designs require a modestly larger maximum sample size than a fixed design (to pay for the looks), but the expected sample size is usually smaller because many trials stop early.
Python support is thinner than for fixed designs; common options:
rpy2 or a subprocess:
gsDesign — the standard for group-sequential boundaries and spending functions.rpact — confirmatory adaptive and group-sequential designs.Broader than group-sequential: the design itself can change at an interim based on accumulating data, within a pre-specified plan that still controls error. Main types:
Adaptive designs are powerful but easy to get wrong: any adaptation that uses the unblinded treatment effect can inflate Type I error and bias the final effect estimate unless the method explicitly corrects for it. Two non-negotiables: