Field note · June 29, 2023
population by region: a 63% spread
Real group means for one column across 5 segments, and what the pooled average conceals.
Breaking population down by region on world-indicators, because the headline average is 130,641,222 and no segment is actually there.
Americas— mean 162,193,332, median 165,799,999 (144 rows)Asia— mean 153,218,098, median 154,507,140 (168 rows)Africa— mean 123,677,258, median 124,790,250 (144 rows)Oceania— mean 112,462,161, median 122,674,867 (72 rows)Europe— mean 99,262,493, median 110,574,882 (192 rows)
Top to bottom that is 162,193,332 against 99,262,493, a spread of 63.4%. The pooled average is 130,641,222.
select region,
count(*) as rows,
round(avg(population)::numeric, 2) as mean,
percentile_cont(0.5) within group (order by population) as median
from world_indicators
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 Americas 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 only slightly here. 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.