census = ({
"Idaho": {shares: [3.89, 9.90, 15.70, 23.04, 47.48], gini: 0.4345},
"United States": {shares: [3.00, 8.55, 14.39, 22.59, 51.47], gini: 0.4809}
})
lorenz = shares => {
const total = d3.sum(shares)
let cum = 0
return [{x: 0, y: 0}, ...shares.map((s, i) => ({x: (i + 1) / 5, y: (cum += s / total)}))]
}
// Trapezoid rule on five quintile points
giniOf = pts => 1 - d3.sum(pts.slice(1), (p, i) => (p.x - pts[i].x) * (p.y + pts[i].y))Lorenz curves and the Gini coefficient
Interactive Lorenz curve and Gini coefficient explorer with Idaho and US Census data.
Line up every household from poorest to richest. A Lorenz curve asks: what share of all income goes to the bottom 20%? The bottom 40%? If income were shared equally, the curve would follow the diagonal. The Gini coefficient measures the gap between the diagonal and the curve. It runs from 0 (everyone has the same income) to 1 (one household has everything).
Build your own economy. Here is the average household income in each fifth, in thousands of dollars:
Try this
- Set all five sliders to the same income. What does the curve look like, and what is the Gini?
- Now double every household’s income. Does the Gini change? What does that tell you about what the Gini measures, and what it doesn’t?
- Take $20k from the richest fifth and give it to the poorest fifth. How far does the Gini fall? Now move $20k from the middle fifth to the next fifth. Which transfer matters more?
- Try to match Idaho’s curve. Then try to match the United States. What separates the two?
- Why is the official Census Gini higher than the one computed from just five points? (Hint: what’s hidden inside each fifth?)
Data: U.S. Census Bureau, American Community Survey 2024 1-year estimates, tables B19082 and B19083. Margins of error on the Gini (90% confidence): Idaho ±0.007, United States ±0.001.
Read more: ESPP 5.10, Comparing inequality across the world and 5.12 Doing Economics: Measuring inequality.