KatInterview

Sample Size Planning for a Conversion Experiment and Its Levers

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentspower analysissample sizetwo-proportion z-test

Last updated

Size a two-arm conversion test from a baseline rate and relative lift, then explain how tighter alpha, higher power, uneven splits, clustering, interim looks and overdispersed counts change the required n.

You are planning a randomized experiment on a checkout flow. The current conversion rate is 8.0%. You want the test to reliably detect a relative lift of 8%, which is an absolute increase of 0.64 percentage points (8.00% to 8.64%). Use a two-sided test at alpha = 0.05, 80% power, and an even 1:1 split.

Part A. Starting from the sampling distribution of the difference between two observed proportions, derive the per-arm sample size with a normal approximation. Show the z quantiles you use and compute the number.

Part B. Change one thing at a time from the Part A setup, and say both qualitatively and numerically what happens to the required sample size:

  1. The detectable lift is cut in half.
  2. Alpha is tightened to 0.01.
  3. Power is raised to 90%.
  4. Traffic is split 75% / 25% instead of 50% / 50%.
  5. Observations are clustered within users, with intra-cluster correlation 0.02 and an average of 5 observations per user. Compute the design effect.
  6. You plan two equally spaced analyses (one interim, one final) with O'Brien-Fleming stopping boundaries.

Part C. Suppose the metric is instead an overdispersed count per user, such as items viewed per week, modeled as negative binomial (NB2). Describe how you would re-estimate the required sample size.

Give a structured answer with reasoning, numbers, and the pitfalls you would watch for.

Hints

Hint 1

Set the standardized effect equal to the sum of two quantiles: the distance from the null to the rejection cutoff (z for 1 - alpha/2) plus the distance from the cutoff to the true effect (z for power). Then solve for n.

Hint 2

Most levers act through the factor (z_alpha + z_beta)^2 or through the effect size squared. For the rest, find the variance multiplier: 1/(4r(1-r)) for uneven splits, 1 + (m-1)*ICC for clustering, and a small inflation constant for O'Brien-Fleming.

Hint 3

For NB2 counts, replace the binomial variance with mu + alpha*mu^2 (or work on the log rate-ratio scale, where the variance per arm is about (1/mu + alpha)/n). Always sanity-check by simulating the exact analysis you will run.