Field note · June 23, 2026

revenue_usd by variant: a 48% spread

Real group means for one column across 3 segments, and what the pooled average conceals.

1 min read ·Analytics practice ·statistics practice

Breaking revenue_usd down by variant on ab-test-checkout, because the headline average is 6.92 and no segment is actually there.

  • variant_b — mean 8.43, median 0.00 (2,089 rows)
  • variant_a — mean 6.57, median 0.00 (1,937 rows)
  • control — mean 5.68, median 0.00 (1,974 rows)

Top to bottom that is 8.43 against 5.68, a spread of 48.4%. The pooled average is 6.92.

sql
select variant,
  count(*)                                                 as rows,
  round(avg(revenue_usd)::numeric, 2)                      as mean,
  percentile_cont(0.5) within group (order by revenue_usd) as median
from ab_test_checkout
group by 1
order by mean desc;

A spread that wide means the pooled number is not a summary, it is an artefact of the mix. Change the proportion of variant_b rows and the overall average moves without any individual group changing at all — which is how a metric goes up while every segment goes down.

Notice the mean and median columns disagree most in variant_b, where the mean sits well above the median. Always compute both in the group-by. The comparison between them per segment is free and tells you whether you are looking at a level difference or a tail difference.

This is the setup for Simpson's paradox — the case where every segment moves one way and the total moves the other.