KatInterview

A/B Test Design with Clustered Users and Sequential Looks

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsa/b testingpower analysissequential testing

Last updated

Design a statistically rigorous A/B test that accounts for within-cluster correlation and daily interim checks while controlling the false-positive rate.

Setting the Scene

A product team is rolling out a new streamlined checkout flow and wants to measure its effect on purchase conversion, which currently sits at 10%. Your job is to design the experiment from the ground up.

The goal is to detect a minimum detectable effect (MDE) of 0.5% relative lift (i.e., a shift from 10.00% to 10.05%) with 80% power at a two-sided significance level of α = 0.05.

Two real-world complications make the standard textbook formula insufficient:

Complication 1 — Users share households

Users are not statistically independent. They live in households, and people in the same household tend to buy similarly (shared payment methods, shared accounts, shared habits). The platform observes:

  • Intra-class correlation coefficient (ICC) = 0.05
  • Average household size m = 2.5 users

You must inflate the sample size to account for this clustering.

Complication 2 — The team wants daily progress checks

Rather than waiting for the full experiment to conclude, stakeholders want to peek at the results every day for up to 10 days and stop early if the effect looks significant. Naively testing at p < 0.05 on each peek inflates the true false-positive rate well above 5%.


Your Tasks

  1. Base sample size: Using the formula below, calculate the per-arm sample size N assuming users are fully independent.
  2. Clustered adjustment: Apply the design effect to compute the adjusted per-arm sample size.
  3. Sequential monitoring: Explain how you would set per-look thresholds so that the overall Type I error rate stays at 0.05 across all 10 interim checks.

Formulas and Constants

Per-arm sample size (standard):

$$N = \frac{(Z_{\alpha/2} + Z_{\beta})^2 \cdot 2p(1-p)}{\delta^2}$$

Design Effect:

$$DE = 1 + (m - 1) \cdot ICC$$

Z-values to use:

  • $Z_{0.025} = 1.96$ (two-sided α = 0.05)
  • $Z_{0.20} = 0.84$ (power = 80%)

What a Strong Answer Covers

  • Correct conversion of the relative MDE into an absolute delta (this is the most common trap)
  • Arithmetic for both the base and clustered sample sizes, with units clearly stated (users per arm, total users, households)
  • Why clustering inflates variance and why randomization must happen at the household level
  • A named, principled method for controlling error under sequential monitoring — not just "be careful when peeking"
  • At least one practical consideration about running this test in the real world

Hints

Hint 1

The MDE is stated as a relative lift. Convert it to an absolute difference in conversion rates before plugging it into the sample size formula — 0.5% of 10% is not 0.5 percentage points.

Hint 2

The design effect tells you how much the variance is inflated by clustering. Multiplying N by the DE gives you the number of users you need; dividing that by the average household size gives you the number of households to randomize.

Hint 3

Testing daily for 10 days is a multiple-looks problem, not a multiple-treatments problem. Think about methods like Pocock, O'Brien–Fleming, or alpha-spending functions that distribute the total α budget across planned interim analyses.