7/13
Part 5 of 7 · When the CLT is slowLearn

Skewed metrics need far more data before the curve fits

Order values aren't flat. Most orders are small and a few are huge, which makes them skewed to the right. Here the widget starts on order values: at 30 orders the averages are still lopsided.

The averages of n order valuesInteractive
Draws averaged
$0$100$200$300the average of 30
3,000 simulated averages normal curve, mean μ and spread σ/√n
Mean of averages
$89
Spread of averages
$21
σ/√n
$22
Skew
0.96
Each bar counts averages of 30 draws of the order value, skewed with a long right tail. They spread $21 around $89, close to σ/√n = $22, and their shape is not normal yet.

Kohavi and colleagues found that many metrics in online experiments are skewed like this. At one commerce site, the skewness of revenue per customer was over 30. Here's how a normal 95% interval does on the shop's order values:

import numpy as np

rng = np.random.default_rng(8)
# order values: e to the power of a normal with mean 4 and sd 1
true_mean = np.exp(4.5)
for n in (30, 300, 3_000):
    x = np.exp(rng.normal(4, 1, size=(2_000, n)))
    m, s = x.mean(axis=1), x.std(axis=1, ddof=1)
    covered = np.abs(m - true_mean) < 1.96 * s / np.sqrt(n)
    print(f"n = {n:5,}: the 95% interval covers the true mean {covered.mean():.1%} of the time")
Predict

With 30 orders, how often does the usual 95% interval contain the true mean order value?

Pick one to see what it prints.