Skip to the page

Statistics and experiments · mid

Sample size, power and test length

Before a test, fix the smallest effect worth detecting, the significance level and the power, then work out how many users each group needs. Halving the effect needs four times the users.

The notes

What you must know

  • Power is the chance of detecting the lift if it is really there. 80% power means a one-in-five chance of missing a real effect of that size.
  • Rule of thumb for a two-sided 5% significance level and 80% power: n per group is about 16 times p(1 - p) divided by delta squared, where delta is the absolute difference.
  • Example: conversion 10%, detect 10.5% (delta 0.005): 16 x 0.09 / 0.005^2 = 57,600 users per group, about 1.15 lakh in total.
  • Halving the effect needs 4 times the sample. A 1% relative lift (0.1 points) needs 25 times more than a 5% relative lift, about 14.4 lakh per group.
  • Even if traffic gives the sample in 3 days, run at least one or two full weeks so weekdays, weekends and salary days are covered and novelty settles.
  • The minimum detectable effect is a business choice: the smallest lift worth the cost of building and running the change. Choose it before the test, never after seeing data.
  • Low traffic: test a bolder change, use a less noisy metric, reduce variance with pre-test data (CUPED), or accept a larger minimum effect.
  • Use a calculator or code (for example statsmodels) for the exact number, but be able to do the rough math.

The red pen

Common traps: mistake → fix

  • Mistake: Stop when the sample looks big enough

    Fix: fix the size and end date in advance.

  • Mistake: A 5% relative lift needs about the same users as a 1% lift

    Fix: the smaller effect needs far more.

  • Mistake: If the traffic is enough in 3 days, 3 days is enough

    Fix: weekly patterns and novelty need full weeks.

Easy to hard

Questions interviewers ask, easy to hard

  1. How many users do you need to detect a lift from 10% to 10.5%?
  2. What is statistical power?
  3. What happens to the sample size if you want to detect half the effect?
  4. Traffic is too low for the test. What are your options?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview