liveBook · Manning

Gini coefficient

As explained in Statistics Slam Dunk

A Gini coefficient is a summary measure of inequality derived from the area between a Lorenz curve and the line of perfect equality, typically ranging from zero for complete equality toward one for greater inequality.

The Gini coefficient summarizes how unequally a quantity is distributed across a population. A value of 0 means perfect equality; a value of 1 means perfect inequality. Higher values therefore indicate greater dispersion. As a rough guide, values below 0.30 indicate low inequality, 0.30–0.40 moderate inequality, 0.40–0.60 significant inequality, and above 0.60 high inequality. section 12.1

Use it to answer a practical distribution question: are salaries, wealth, income, productivity, or another numeric resource concentrated in relatively few people? It is a relative measure, not an absolute one. Identical coefficients can conceal very different distributions and standards of living, so pair the number with a distribution view rather than treating it as a complete description. section 12.1 section 13.11

Start with small income vectors

If 10 people each earn $50, the coefficient is 0. If five earn $50 and five earn $100, it is about 0.17. Raising those two income levels to $150 and $300 leaves the coefficient at about 0.17: inequality is unchanged because the relative split is unchanged. When nine people earn $10 and one earns $100, it rises to about 0.43. section 12.5

A Lorenz curve makes the same idea visible by plotting cumulative distribution against the population. The diagonal marks perfect equality; the farther the curve bends away from that line, the more unequal the distribution. Keep both axes at the same scale to make the curve interpretable. section 12.6

a <- rep(c(50), each = 10)
print(a)
##  [1] 50 50 50 50 50 50 50 50 50 50

ineq(a)
## [1] 0

Pass a numeric vector to `ineq()` to calculate a coefficient; the equal-income vector returns 0. section 12.5 section 12.2

For NBA salary analysis, first retain a comparable maximum of 14 player salaries per team-season, then compute a coefficient for each season or team-season. Missing salary slots can be ignored when a team has fewer than 14 salaries. Join the resulting index to wins, losses, winning percentage, and championship status before comparing groups. section 12.4 section 12.7.1

Across league salaries from 1991–2018, championship teams averaged a Gini coefficient of 0.53 versus 0.48 for other teams; winning teams averaged 0.50 versus 0.46 for losing teams. The reported t-tests found both differences statistically significant. These comparisons describe an association, not a universal rule that inequality causes winning. section 12.7.2 section 12.8.1

The same calculation can measure inequality in player win shares rather than salaries. Plotting multiple Lorenz curves together helps compare distributions across seasons, while Gini bands can summarize how inequality levels align with average winning percentages. section 13.4 section 13.5 section 13.10

How Statistics Slam Dunk covers it

How deep it goes
Defines and manually demonstrates the metric, then computes, plots, groups, and tests it in R without formal derivation.
Examples
Uses equal and unequal monthly incomes, NBA player salaries, team records, championship status, and player win shares.
What it assumes
Teaches the metric from zero while using basic R vectors, data wrangling, ggplot2, and introductory hypothesis testing.
What you can do after
Apply it via R’s ineq package to compute inequality indices, visualize Lorenz curves, and compare NBA team groups.
How it connects
Connects Gini coefficients to Lorenz curves, statistical dispersion, t-tests, Cohen’s d, winning percentage, and win shares.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.