Field note · July 22, 2023

vibration_mm_s by site: a 29% spread

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

1 min read ·Analytics practice ·statistics practice

Breaking vibration_mm_s down by site on sensor-telemetry, because the headline average is 2.93 and no segment is actually there.

  • NOR — mean 3.36, median 3.12 (2,823 rows)
  • RIV — mean 2.81, median 2.80 (2,355 rows)
  • SLT — mean 2.60, median 2.61 (2,822 rows)

Top to bottom that is 3.36 against 2.60, a spread of 29.0%. The pooled average is 2.93.

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

The groups are close enough that the pooled average is a fair summary. That is worth confirming rather than assuming: the check costs one query and the failure mode is invisible.

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.