Problem
Product analysts at Lamoda decide whether to roll out a feature from A/B test results. The bootstrap is a popular way to read such results, but it is purely empirical: no formula links its power to the sample size. The sample size, and with it the test duration, must still be fixed before the test starts.
Example from the article: two exponential populations with means 1900 and 1919 (a 1% effect), tested with a bootstrap at sample sizes from 50,000 to 275,000 per group.
Solution in brief
Take the sample size from the t-test formula and verify it by simulation. For each candidate sample size or MDE, run 1000 bootstrap tests on synthetic or historical data, compute the share of significant results (empirical power) and its confidence interval, and check that the planned power falls inside that interval.
Questions this case answers
- How to plan the sample size of an experiment when the test statistic is computed by resampling and has no closed-form power formula
- How to choose the sample size for an A/B test that is analyzed with the bootstrap?
- How to check that the t-test sample size formula is good enough for a bootstrap-based test?
- How to estimate empirical power of a test by simulation on historical data?
Tools and methods
- Bootstrap — the significance test whose power is being checked
- t-test sample size formula — gives the candidate sample size
- Monte Carlo simulation — 1000 repeated tests per setting to measure empirical power
- Wilson binomial confidence interval — compares empirical and planned power
- SciPy, statsmodels, NumPy, pandas — the code stack of the article
Google or a one-time email code. No password.