Skip to the workspace
Pebellslearn by building
Statistical Inference  ›  Capstone Project

Errors, Power and Sample Size

Statistics 15 minA test can raise a false alarm or miss a real effect, and choosing the smallest effect worth detecting before the test fixes how many users it needs to have enough power.

ai data scientist / Errors, Power and Sample Size

Explore each scene at your own pace.

01 · The rule

The rule

Errors, Power and Sample Size

Before the checkout test, someone else at Pantry tested a "Reorder" button for three days with 1,000 users per arm. The result was p = 0.4, and the product manager declared: "The button doesn't work." Maybe. Or maybe the test was far too small to notice a button that does work. Deciding how big a test must be before it starts is what separates an experiment from a coin toss.

The rule

Decide the smallest effect worth finding, then buy enough sample to see it.

Every test can go wrong in two ways:

  • A Type I error is a false alarm: declaring a winner when the change does nothing. Its rate is the significance level, α\alpha, usually 5%.
  • A Type II error is a miss: failing to detect a change that really works. Power is the chance of not missing, and teams usually aim for 80%.

Power depends on the size of the effect you hope to catch. The minimum detectable effect (MDE) is the smallest lift worth acting on, and it comes from the decision, not from the data. For comparing two conversion rates at α=0.05\alpha = 0.05 with 80% power, a well-known rule of thumb is

nper arm≈16 p(1−p)δ2n_{\text{per arm}} \approx \frac{16\, p(1-p)}{\delta^2}

where pp is the baseline rate and δ\delta is the MDE, both as proportions. For Quick Checkout, p=0.1p = 0.1 and δ=0.01\delta = 0.01 (one point): 16×0.09/0.0001=14,40016 \times 0.09 / 0.0001 = 14{,}400 users per arm. That is exactly why the test ran with 14,400 users in each group.

Because δ\delta is squared, halving the effect you want to detect needs four times the users.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.