A/B tests · AdvancedA/B test simulator

An A/B test simulator: thousands of virtual tests with a known truth show how often a test finds a real effect, how many false wins an A/A test, peeking and 20 metrics produce, and how much a “win” overstates the uplift, the winner's curse. Five scenarios, the p-value path of one test, CSV and code.

Your numbers stay in the browser and are never sent anywhere

01Parameters02Uplifts03One test04Code05Scenarios06Questions07Related
01

Parameters

When we check
Metrics in the test
Runs
seed 1 · 1,000 tests
α = 0.05 · two-sided test
The test finds the effect in 82 % of cases.
The power is sufficient. Among the “wins”, the mean observed uplift is +16.9 %, 1.1 times the true one: this is the winner's curse.
Win rate (power)
81.5 %
815 of 1,000
True effect
+15.0 %
2.00 → 2.30 %
Mean uplift among wins
+16.9 %
overstated 1.1 times
Visitors per group
37,800
2,700 × 14 days
Checks per test
1
at the end
Metrics
1
one primary
02

Observed uplift across all tests

Observed uplift across all tests
Red marks tests found significant; the dashed line is the true effect
−33 %−16 %0 %+16 %+33 %
03

One test day by day

One test day by day
p-value after each day; below the red line means “significant”
α1day 1day 14

In this test the p-value dropped below α on day 11 and stayed there until the end of the test.

04

Check in Python / R

Check in Python / R
import numpy as np
from scipy import stats

rng = np.random.default_rng(1)
pa, pb, per_day, days, runs = 0.02, 0.023, 2700, 14, 1000
def z(a, b, n):
    p = (a + b) / (2 * n)
    return (b - a) / n / np.sqrt(p * (1 - p) * 2 / n)

# одна проверка в конце: доля побед и проклятие победителя
n = per_day * days
a = rng.binomial(n, pa, runs)
b = rng.binomial(n, pb, runs)
win = np.abs(z(a, b, n)) > stats.norm.ppf(0.975)
up = b / a - 1
print(win.mean(), up[win & (up > 0)].mean())
05

Scenarios

06

Frequently asked questions

To see how often a test is wrong with your parameters. A thousand virtual tests with a known truth take a fraction of a second and show the power, the false win rate and the cost of peeking. Formulas say the same thing, but a histogram of a thousand results convinces faster: you see how differently one and the same effect can look.

Updated