A/B testing

Step 7 of 9 in Data Science · Build · Medium

Randomly split users, change one thing, compare. A two-proportion z-test tells you if the difference is bigger than chance; sample size decides if you could have seen it.

Build it

  1. Test by hand

    Control 200/2000, variant 250/2000: compute z and p by formula, then verify with statsmodels.

    Done when: Numbers match; ship decision stated.

  2. Sample size & peeking

    Compute sample size for a 10% relative lift, then simulate stopping as soon as p < 0.05 and measure the false-positive rate.

    Done when: Peeking gives far more than 5% false positives.

Case study: Bing's $100M headline test

  • A small change to ad headlines, deprioritized for months, raised revenue ~12%.
  • Experts' intuition about which ideas would win was usually wrong.
  • Running many cheap experiments beat debating in meetings.

Read the case study

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map