Financial Planning and Analysis

How to Calculate the Gini Coefficient

Quantify economic inequality. This guide shows you how to calculate and interpret the Gini Coefficient for any dataset.

The Gini coefficient quantifies income or wealth distribution within a population. It shows how evenly resources are spread among individuals or households. Economists and sociologists use this metric to represent inequality numerically. Its purpose is to assess how far a given distribution deviates from perfect equality.

Preparing Your Data for Calculation

Calculating the Gini coefficient begins with preparing data, typically individual or household income or wealth. First, sort all income or wealth data points in ascending order, from the lowest value to the highest. This organization is fundamental for assessing cumulative resource distribution.

Next, determine the cumulative share of the population. For individual data points, each person or household is an equal portion of the total population, and you calculate their cumulative percentage. For instance, in a group of 100 individuals, each represents 1%, and the cumulative share for the first 10 sorted individuals would be 10%.

Then, compute the cumulative share of income or wealth. Sum the income or wealth of each individual or group in the sorted list, expressing this sum as a percentage of the total income or wealth. As you move through the sorted data, the cumulative income or wealth steadily increases, reflecting the accumulated resources held by progressively larger segments of the population. These cumulative shares form the basis for visualizing and calculating the Gini coefficient.

Visualizing Inequality: The Lorenz Curve

The Lorenz Curve visually represents income or wealth distribution, using the cumulative data. It plots the cumulative percentage of the population on the horizontal (x) axis (0-100%) and the cumulative percentage of total income or wealth on the vertical (y) axis (0-100%).

The “line of perfect equality” is a straight 45-degree diagonal line from the origin (0,0) to (100,100). This line illustrates a hypothetical scenario where income or wealth is distributed perfectly equally, meaning the bottom 20% of the population earns 20% of the income, the bottom 50% earns 50%, and so on. The actual Lorenz Curve is plotted by connecting points from your cumulative population and income/wealth shares. This curve will lie below the line of perfect equality, bowing further away from it as inequality increases.

Area A is the area between the line of perfect equality and the Lorenz Curve, representing inequality. Area B is the area beneath the Lorenz Curve. Together, Area A and Area B form the entire triangular region under the line of perfect equality, totaling 0.5 when axes are scaled from 0 to 1. These areas are directly used in the Gini coefficient calculation.

Step-by-Step Gini Coefficient Calculation

The Gini coefficient is derived numerically from the Lorenz Curve areas, providing a single value for inequality. The most common formula for the Gini coefficient, based on these areas, is G = A / (A + B), where A is the area between the line of perfect equality and the Lorenz Curve, and B is the area beneath the Lorenz Curve. Since the total area under the line of perfect equality (A + B) is always 0.5 (assuming axes from 0 to 1), the formula simplifies to G = A / 0.5, or more commonly, G = 2A. Alternatively, because A + B = 0.5, Area A can be expressed as 0.5 – Area B, leading to the formula G = (0.5 – Area B) / 0.5, or G = 1 – 2B.

For discrete data points, Area B is calculated using the trapezoidal rule, which approximates the area under the curve by summing trapezoids formed by consecutive data points. For example, consider a small population of five individuals with incomes: $10, $20, $30, $40, and $50. The total income is $150.

First, normalize the data by dividing each income by the total income, and each person by the total number of people.
| Person (Sorted) | Income ($) | Cumulative Income ($) | Cumulative Pop. Share (x_i) | Cumulative Income Share (y_i) |
|—|—|—|—|—|
| 1 | 10 | 10 | 0.2 | 0.067 |
| 2 | 20 | 30 | 0.4 | 0.200 |
| 3 | 30 | 60 | 0.6 | 0.400 |
| 4 | 40 | 100 | 0.8 | 0.667 |
| 5 | 50 | 150 | 1.0 | 1.000 |

To calculate Area B using the trapezoidal rule, sum the areas of trapezoids formed by consecutive points (x_i, y_i) and (x_{i-1}, y_{i-1}), where x_0 = 0 and y_0 = 0. The area of each trapezoid is (x_i – x_{i-1}) (y_i + y_{i-1}) / 2.
For the example:
Trapezoid 1: (0.2 – 0) (0.067 + 0) / 2 = 0.0067
Trapezoid 2: (0.4 – 0.2) (0.200 + 0.067) / 2 = 0.0267
Trapezoid 3: (0.6 – 0.4) (0.400 + 0.200) / 2 = 0.0600
Trapezoid 4: (0.8 – 0.6) (0.667 + 0.400) / 2 = 0.1067
Trapezoid 5: (1.0 – 0.8) (1.000 + 0.667) / 2 = 0.1667

Summing these trapezoidal areas gives Area B = 0.0067 + 0.0267 + 0.0600 + 0.1067 + 0.1667 = 0.3668. Now, use the formula G = 1 – 2B. G = 1 – 2 0.3668 = 1 – 0.7336 = 0.2664.

Interpreting Your Gini Coefficient Result

The Gini coefficient indicates income or wealth inequality within the analyzed population. It always falls between 0 and 1. Understanding this range is essential for interpretation.

A Gini coefficient of 0 signifies perfect equality, meaning every individual or household has the same income or wealth. Conversely, a Gini coefficient of 1 represents perfect inequality, a theoretical scenario where one individual holds all income or wealth, and everyone else has none. Values between these two extremes indicate varying degrees of inequality. A higher Gini coefficient, closer to 1, suggests a greater disparity in distribution, while a lower coefficient, nearer to 0, points to a more equitable distribution of resources. This allows for direct comparisons of inequality levels across different populations or over various time periods.

Previous

Can You Dispute a Late Fee on a Credit Card?

Back to Financial Planning and Analysis
Next

How to Apply for Student Loan Deferment