Revenue's heavy tail needs more users, a cap or equal groups
Every test so far counted conversions, a 0 or a 1 for each user. Revenue per user is different: most users spend nothing and a few spend a lot.
20 users' revenue in one week (an example)
14 users
The other 6
Mean
raw
$0 each
$4, 6, 9, 12, 25, 480
$26.80
capped at $10
$0 each
$4, 6, 9, 10, 10, 10
$2.45
One user holds 90% of all the revenue.
So the test changes shape. Compare means, with each group's own sample variance s2. That's Welch's test:
SE=nAsA2+nBsB2
In words: each group's sample variance over its users, added, under one square root. There's no pooled-rate step, because a mean doesn't fix the variance the way p(1−p) does.
The tail is the real problem. A few big spenders dominate the variance, so the test is noisy, and the average needs far more users before it's close to normal.
Predict
Revenue per user has a skewness of 18. A rule of thumb asks for at least 355 × skewness² users per variant. About how many is that?
Kohavi and colleagues' rule of thumb is at least 355s2 users per variant, where s is the metric's skewness. Skewness measures how lopsided a distribution is: 0 for a symmetric one, and large and positive when a long tail of big values stretches it to the right. This s is that number, not the standard deviation in Welch's formula above. At Bing, revenue per user had a skewness of about 18, which puts the floor near 115,000 users per variant.
Cap it. Replace values above a threshold with the threshold, as in the table. Capping revenue at $10 per user per week cut the skewness from about 18 to about 5, and the capped metric could detect a change 30% smaller with the same users. Pick the cap before the test, and count how many values it touches.
Split 50/50. With equal groups, the difference in means is symmetric under the null even when each mean is skewed. Their advice: "ensure that the control and treatment are equally sized." In a simulation of a revenue-like metric, the difference had a skewness of 0.02 with a 500/500 split and -3.5 with 100/900.
Bootstrap the interval when the sample is small, resampling users within each group.
Reduce the variance with pre-experiment data. That's CUPED, which the CUPED lesson covers.
Keep the question. A log transform or a Mann-Whitney test can be more sensitive. But they answer a different question than whether revenue per user went up, and revenue is usually a question about the mean.
In the editor, revenue holds the table's 20 users. Write capped_mean(values, cap) and users_needed(skew): what the cap does to the mean, and the rule of thumb.
Pick an answer above to see the rest
Instructions
1
Write capped_mean(values, cap): the mean after every value above cap is replaced by cap.
2
Then write users_needed(skew): Kohavi's rule of thumb, at least 355 times the skewness squared users per variant.