Field note · January 18, 2024
seats by industry: a 53% spread
Real group means for one column across 8 segments, and what the pooled average conceals.
Breaking seats down by industry on saas-subscriptions, because the headline average is 51 and no segment is actually there.
finance— mean 60, median 6 (293 rows)public sector— mean 55, median 7 (334 rows)software— mean 51, median 10 (326 rows)media— mean 51, median 8 (296 rows)retail— mean 51, median 10 (314 rows)healthcare— mean 50, median 11 (334 rows)
Top to bottom that is 60 against 40, a spread of 53.0%. The pooled average is 51.
select industry,
count(*) as rows,
round(avg(seats)::numeric, 2) as mean,
percentile_cont(0.5) within group (order by seats) as median
from saas_subscriptions
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 finance 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 finance, 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.