Inconclusive A/B Test: Power, CUPED, Bayesian Rules, Sequential Looks
Statistics & ExperimentsModel answerLast updated
An A/B test on a 60-second video change was not significant. Size the test, cut variance, decide what to do next, control multiplicity, and design a valid sequential plan.
A team changed how 60-second videos are presented and ran a randomized experiment. The primary metric is the completion rate, which is 22% in the control group. At a two-sided significance level of 0.05, the measured lift is not statistically significant.
Product says the smallest improvement worth shipping is a 5% relative gain, from 22% to 23.1%. Assume two equal-sized arms, a two-sided test, and 80% power.
Answer the following:
- Sample size. Compute the required number of users per arm. State the formula and every assumption behind it.
- Variance reduction. Propose a method such as CUPED or covariate adjustment using pre-experiment completion. If the covariate explains R² = 0.25 of the outcome variance, quantify the gain in sample size, detectable effect, and power.
- What next? Decide whether to keep collecting data, stop, or switch to a Bayesian, utility-based decision rule. Say what evidence would drive each choice.
- Multiplicity. Several related outcomes (watch time, shares, retention, guardrails) are monitored alongside the primary metric. How do you control error rates?
- Sequential design. Outline a group-sequential plan, such as O'Brien–Fleming, that would have allowed early looks while keeping the Type I error at 5%.
Give concrete numbers and explain the reasoning behind each choice.
Hints
Hint 1
For part 1, the absolute difference is 0.011, not 0.05. Use n = (z_{1-α/2} + z_{1-β})² · [p₁(1−p₁) + p₂(1−p₂)] / δ² with z-values 1.960 and 0.842.
Hint 2
CUPED multiplies the outcome variance by (1 − R²). Sample size scales by the same factor, and the detectable effect scales by its square root.
Hint 3
For part 3, look at where the confidence interval sits relative to both 0 and the minimum meaningful effect, instead of at the p-value alone. For part 5, space the looks by information fraction and spend alpha sparingly early on.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Framing
"Not significant" means the data could not rule out zero. It does not show there is no effect. The first job is to find out whether the test was capable of detecting the effect we care about, and then to choose an action that does not inflate error rates.
1. Sample size per arm
Setup: p₁ = 0.22, p₂ = 0.231, so δ = 0.011 (1.1 percentage points). Two-sided α = 0.05 gives z = 1.960, and 80% power gives z = 0.842.
For a two-proportion z-test with equal allocation:
n = (z_{1-α/2} + z_{1-β})² · [p₁(1−p₁) + p₂(1−p₂)] / δ²
- p₁(1−p₁) = 0.1716 and p₂(1−p₂) ≈ 0.1776, so the sum is ≈ 0.3492
- (1.960 + 0.842)² ≈ 7.849
- δ² = 0.000121
n ≈ 7.849 × 0.3492 / 0.000121 ≈ 22,650 per arm (about 45,300 in total). A pooled-variance version gives nearly the same answer.
from scipy.stats import norm
p1, p2 = 0.22, 0.231
za, zb = norm.ppf(0.975), norm.ppf(0.80)
n = (za + zb) ** 2 * (p1*(1-p1) + p2*(1-p2)) / (p2 - p1) ** 2
Assumptions to state:
- The randomization unit is the analysis unit. If users are randomized but completion is measured per view, views within a user are correlated. Use cluster-robust or delta-method variance, because the effective sample shrinks by the design effect 1 + (m−1)ρ.
- There is no interference between arms, no strong novelty effect, and stable traffic.
- A 1.1 pp effect is small, which is why the sample is large. A test with far fewer users would be expected to come back non-significant even if the effect is real.
2. Variance reduction
CUPED replaces the outcome with Y_adj = Y − θ(X − X̄), where X is the user's pre-period completion rate and θ = Cov(X,Y)/Var(X). Regressing Y on the treatment indicator plus X gives an asymptotically equivalent estimate and extends to more covariates such as device, tenure, and past watch time.
Variance falls by a factor of (1 − R²) = 0.75:
- Sample size: 0.75 × 22,650 ≈ 16,990 per arm, a 25% saving.
- Detectable effect at the same n: shrinks by √0.75 ≈ 0.866, so 5% relative becomes about 4.3% relative.
- Power at the original n: the z-statistic grows by 1/√0.75 ≈ 1.155, so power = Φ(2.802 × 1.155 − 1.96) ≈ Φ(1.28) ≈ 90%, up from 80%.
- Underpowered example: with 15,000 per arm, the raw z for a true 1.1 pp lift is about 2.28, which gives power ≈ 63%. With CUPED, z ≈ 2.63 and power ≈ 75%.
Caveats: the covariate must be measured before exposure, or it absorbs part of the treatment effect. New users lack history, so impute the mean and add a missing-indicator. The gain depends on real correlation, so check R² on historical data before promising savings.
3. Continue, stop, or go Bayesian
Begin with the confidence interval for the lift, compared against 0 and the minimum meaningful effect (+1.1 pp), not with the p-value.
| Interval | Reading | Action |
|---|---|---|
| Entirely below +1.1 pp (e.g. −0.4 to +0.6 pp) | Any effect is smaller than what matters | Stop. Do not ship for this metric. |
| Spans both 0 and +1.1 pp | Inconclusive | If the planned n was not reached, finish as planned. If it was, run a new pre-registered test with CUPED, or use a decision-theoretic rule. |
| Point estimate negative and guardrails worse | Likely harmful | Stop and do not ship. |
Do not keep watching the p-value and extend the test until it dips below 0.05. Unplanned optional stopping can inflate the true false-positive rate far above 5%. Any extension must be pre-planned with alpha spending (part 5) or treated as a new experiment.
Bayesian alternative, appropriate when the real question is "ship or not":
- Choose an empirical prior for the lift from past experiments. Most are small and centered near zero, which shrinks noisy estimates.
- Compute the posterior, approximately normal, for the lift Δ.
- Compute expected utility: value per pp of completion times the posterior expected gain, minus engineering, maintenance, and risk costs. Equivalently, ship if the expected loss E[max(0, −Δ)] is below a tolerance ε.
- Fix the utility function and ε before looking at the data.
This makes cost explicit. A cheap, reversible change with P(Δ > 0) = 0.85 may be worth shipping, while an expensive one with the same posterior may not. Bayesian rules do not make peeking free in terms of frequentist error rates. They are a coherent decision tool, not a way around significance.
4. Multiplicity
- One pre-registered primary metric (completion rate) at α = 0.05 is the ship criterion.
- Key secondaries go through fixed-sequence (gatekeeping) testing. Test the next metric only if the previous one passes, each at full α, which keeps the family-wise error rate controlled.
- Several co-primary metrics: use Holm–Bonferroni, which is uniformly more powerful than Bonferroni. Because the metrics are positively correlated, max-T or permutation adjustments recover more power.
- Guardrails (latency, crashes, retention) are one-sided non-inferiority tests with explicit margins.
- Exploratory metrics and segments: control the false discovery rate with Benjamini–Hochberg and label the results hypothesis-generating.
The pitfall is celebrating one hit among many. With 15 independent tests at 0.05, the chance of at least one false positive is about 54%.
5. Group-sequential design
Plan K = 4 looks at 25%, 50%, 75%, and 100% of the target information (not calendar time). With two-sided overall α = 0.05, the O'Brien–Fleming critical values are approximately:
| Look | Information | Critical |z| |
|---|---|---|
| 1 | 25% | 4.05 |
| 2 | 50% | 2.86 |
| 3 | 75% | 2.34 |
| 4 | 100% | 2.02 |
Early looks demand overwhelming evidence, so almost no alpha is spent there, and the final look is close to the usual 1.96. The price is a small sample inflation, about 1–2%, to keep power at 80%. You can also use a Lan–DeMets alpha-spending function when the look times are not fixed in advance, and add a non-binding futility boundary so clearly null tests stop early. Document the plan and the stopping rules before launch.
Common mistakes
- Reading non-significance as "no effect."
- Computing sample size from the 5% relative lift as if it were an absolute difference.
- Extending a test until p < 0.05.
- Ignoring within-user correlation.
- Using post-treatment covariates in CUPED.
- Declaring a win from one of many metrics.