Reduce Experiment Variance Using Pre-Period Behavior With CUPED
Last updated: November 29, 2026
Quick Overview
Derive the CUPED adjustment for an A/B test metric using each user's pre-experiment value of the same metric, show why it reduces variance without biasing the treatment effect, and implement it.
Mixpanel
November 29, 20260
0
0 solved
Derive the CUPED adjustment for an A/B test metric using each user's pre-experiment value of the same metric, show why it reduces variance without biasing the treatment effect, and implement it.
Experiments on product analytics data are often underpowered for smaller customers, and an analytics vendor like Mixpanel already holds each user's pre-experiment event history, which makes covariate adjustment cheap. The interviewer checks derivation, the conditions for unbiasedness, and practical handling of new users.
What the Interviewer Expects
- Write the adjusted metric and derive the optimal theta
- Show variance reduction equals the squared correlation
- Explain unbiasedness: covariate is unaffected by treatment because it is pre-period
- Pool theta across arms rather than fitting per arm
- Handle users without pre-period data
- Implement and sanity check the adjustment
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- How does CUPED relate to regression adjustment with a treatment indicator?
- What happens if you accidentally use a covariate measured after the experiment started?
- How would you apply this to a ratio metric like conversion per session?
- How much sample size does a correlation of 0.7 save?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Metric (for example events per user during the test), covariate (the same metric in the two weeks before assignment). Randomization is at the user level. We want a lower-variance estimator of ...
Approach
Define . Since is the same in both arms (randomization, and is measured before treatment), , so the estimator stays unbia...