Field note · June 7, 2024

data-job-postings.remote: 3 values, 100.0% in the top three

3 values with 45.5% concentrated in one of them, and what that does to every chart downstream.

1 min read ·Visualization ·visualization practice

Distribution of remote on data-job-postings, because every chart built on it inherits this shape.

  • hybrid — 1,594 rows, 45.5%
  • remote — 1,061 rows, 30.3%
  • onsite — 845 rows, 24.1%

The top three take 100.0% between them. With only 3 values there is no tail to worry about, which makes this a genuinely easy column to chart.

sql
select remote,
       count(*)                                      as rows,
       round(100.0 * count(*) / sum(count(*)) over (), 1) as pct,
       round(avg(salary_min_usd)::numeric, 2)             as avg_salary_min_usd
from data_job_postings
group by 1
order by rows desc;

The second column is the one that matters. Share of rows tells you what is common; avg_salary_min_usd tells you whether the common thing is the important thing. They disagree more often than not, and a chart that shows only the first is answering the easier question.

Decide what happens to the tail before you plot it. "Other" as an explicit bucket is honest; twelve slivers is not, and neither is silently taking the top eight.