Sequential Testing on Statsig

Maggie Stewart18 Oct 2023

Problem

Online experimentation platforms update metrics every day, so teams check results during the test and stop when the p-value drops below 0.05. Each extra look adds a new chance of a false positive. Rolling a 20-sided die once gives a 5% chance of a 1, but rolling it daily for a week gives about 30%. The result is shipped changes that do nothing, or regressions that run to the end of the test.

Example from the article: In Statsig's simulated A/A tests (no true effect), a z-test checked repeatedly flagged a "significant" result in 20.9% of runs, four times the intended 5%.

Solution in brief

Swap the fixed-horizon confidence interval for a sequential one based on the mixture sequential probability ratio test (mSPRT). The interval is wider, but the false positive rate stays under the cap however often you look. In Statsig's evaluation the early stopping probability at half of the target duration was 58%, at the price of 84% of the fixed-horizon power.

Questions this case answers
  • How to make early stop decisions on a running randomized test while keeping the false positive rate under a fixed cap
  • How to validate a stopping rule for continuous monitoring using simulated and real A/A tests
  • How to monitor a running A/B test continuously without inflating the false positive rate?
  • How to stop an A/B test early when a real effect or a regression shows up?

Tools and methods

  • mSPRT (mixture sequential probability ratio test) — likelihood-ratio test that keeps the false positive rate capped under continuous monitoring
  • A/A tests — simulated and real, used to measure the false positive rate
  • Fixed-horizon z-test — baseline for power and false positive rate
  • Statsig — experimentation platform that runs the sequential test
Continue reading — it's free

Google or a one-time email code. No password.