Problem
Analysts who run randomized A/B tests in retail work with the t-test, post-stratification, CUPED and multi-covariate CUPED (CUMPED) as separate techniques, each with its own formulas and code. It stays unclear why they work, how to combine them and which variables are safe to add. Using only one of them leaves variance unexplained, so confidence intervals stay wide and smaller effects go undetected.
Example from the article: on simulated data with a true treatment effect of 5, the standard error of the effect estimate is 0.066 with a plain t-test and 0.012 when all techniques are combined.
Solution in brief
All four techniques are one linear regression: the outcome on the treatment flag plus covariates (pre-experiment metric, stratum dummies, other covariates). The coefficient on is the average treatment effect (ATE). Every valid covariate shrinks the standard error of that coefficient, so put them all into one OLS model.
Questions this case answers
- How to reduce the variance of a randomized experiment's effect estimate by combining several variance reduction techniques in one model
- How to choose covariates for adjustment in a randomized experiment so that the effect estimate stays unbiased
- How to run a t-test, post-stratification, CUPED and multi-covariate CUPED as one regression instead of four separate procedures?
- How to shrink the standard error of an A/B test effect estimate with pre-experiment covariates?
Tools and methods
- Linear regression (OLS) — one model that returns the ATE, its standard error and confidence interval.
- Regression adjustment (CUPED, CUPAC, CUMPED) — pre-experiment metric, ML prediction or several covariates as regressors.
- Post-stratification — dummy variables for strata (age groups in the example).
- t-test — the same estimate as a regression on the treatment flag alone; the baseline for comparison.
- statsmodels, pandas — OLS fits and coefficient tables; dummy variables for strata.
Google or a one-time email code. No password.
