Problem
A ratio metric appears when one experiment unit yields several measurements. Customers, for example, make different numbers of purchases in a week. The average check is the total purchase value divided by the number of purchases, so it is not an ordinary per-customer metric. Delta method and bootstrap evaluate such metrics, but the sensitivity techniques CUPED and stratification do not apply to them directly.
Example from the article: an online store sends push notifications to customers and compares the average check after a week; some customers buy nothing, some once, some several times.
Solution in brief
Turn the ratio metric into an ordinary per-customer metric: , where is the ratio in the control group. Run a t-test on , and add CUPED if pre-experiment data exist. The method breaks when the distribution of the denominator differs strongly between groups.
Questions this case answers
- How to test a ratio of two per-unit sums, where units contribute different numbers of observations, with a standard test and variance reduction
- How to check that a custom test statistic is valid before using it in decisions
- How to test a difference in a ratio metric such as average check when each customer makes a different number of purchases?
- How to apply CUPED to a ratio metric?
Tools and methods
- Ratio metric linearization — turns the ratio into one value per customer, so standard tests apply
- t-test — tests equality of the mean linearized values between groups
- CUPED — reduces variance using the linearized pre-experiment metric as a covariate
- A/A and A/B simulation — checks that A/A p-values are uniform and A/B p-values lean toward small values
- SciPy, NumPy — the code in the article
Google or a one-time email code. No password.
