DM7: A/B tests done honestly

Lesson 2 of 5 · reading 15–25 minutes; practice and project time is on the module page

Sample size and power

🎯You'll be able to

Explain significance level, power and minimum detectable effect, and calculate the visitors a test needs.

🏠The everyday picture

To tell whether a coin is slightly unfair, ten tosses aren't enough: you'd need hundreds. The smaller the difference you want to detect, the more tosses it takes.

📘What it really is

📝A worked example

Input: sampleSize({ baseline: 0.03, mde: 0.006 }), with about 1,500 visitors a day entering the test.

Steps:

  1. Calculate: 13,914 per variant, 27,828 in all.
  2. Days: 27,828 ÷ 1,500 = 18.6, so 19 days.
  3. Round up to whole weeks: 21 days.

Expected output: the Sample size and Duration sections of the plan, and Project 2's test 1 passing when sampleSize returns 13,914 (and 10,921 for a 5% baseline, a 1-point MDE and 90% power).

🌍Where it's used

📝Case scenario

A small online bookshop with 300 visitors a day wanted to detect a 5% relative lift on a 2% conversion rate. The calculation said more than 3 lakh visitors per variant: almost six years of traffic. They tested a much bolder change instead, and used customer interviews for the small ideas.

🖱️Try it

In the kit, call sampleSize (after fixing it) with a baseline of 10% and an MDE of 2 points, then with an MDE of 1 point. Success: the second needs roughly four times as many visitors (about 3,841 and about 14,750).

⚠️Common mistakes

🛠️For your project

Project 2's test 1 checks your sampleSize; test 8 checks the plan's visitors per variant and days.

✅Quick check

What happens to the sample size if you halve the minimum detectable effect?

Show the answer

It roughly quadruples.

Why round a test's duration up to whole weeks?

Show the answer

So every day of the week, with its different visitors, is included equally.

← PreviousHypotheses and metrics
ProLearners Assist