Field note · May 31, 2026

dep_delay_min by carrier: a 85% spread

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

1 min read ·Analytics practice ·statistics practice

Breaking dep_delay_min down by carrier on flight-delays, because the headline average is 10 and no segment is actually there.

  • B6 — mean 13, median 8 (766 rows)
  • AA — mean 11, median 7 (1,751 rows)
  • UA — mean 11, median 6 (1,422 rows)
  • WN — mean 10, median 4 (1,652 rows)
  • AS — mean 7, median 2 (725 rows)
  • DL — mean 7, median 3 (1,684 rows)

Top to bottom that is 13 against 7, a spread of 84.8%. The pooled average is 10.

sql
select carrier,
  count(*)                                                   as rows,
  round(avg(dep_delay_min)::numeric, 2)                      as mean,
  percentile_cont(0.5) within group (order by dep_delay_min) as median
from flight_delays
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 B6 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 B6, 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.