You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we plot Lorenz curves for net wealth, total income and labor income in the
290
287
US in 2016.
291
288
289
+
Total income is the sum of households' all income sources, including labor income but excluding capital gains.
290
+
291
+
(All income measures are pre-tax.)
292
+
292
293
```{code-cell} ipython3
293
294
---
294
295
mystnb:
@@ -309,31 +310,26 @@ ax.legend()
309
310
plt.show()
310
311
```
311
312
312
-
Here all the income and wealth measures are pre-tax.
313
313
314
-
Total income is the sum of households' all income sources, including labor income but excluding capital gains.
314
+
One key finding from this figure is that wealth inequality is more extreme than income inequality.
315
+
315
316
316
-
One key finding from this figure is that wealth inequality is significantly
317
-
more extreme than income inequality.
318
317
319
-
We will take a look at this trend over time {ref}`in a later section<compare-income-wealth-usa-over-time>`.
320
318
321
319
## The Gini coefficient
322
320
323
321
The Lorenz curve is a useful visual representation of inequality in a distribution.
324
322
325
-
Another popular measure of income and wealth inequality is the Gini coefficient.
326
-
327
-
The Gini coefficient is just a number, rather than a curve.
323
+
Another way to study income and wealth inequality is via the Gini coefficient.
328
324
329
325
In this section we discuss the Gini coefficient and its relationship to the
330
326
Lorenz curve.
331
327
332
328
329
+
333
330
### Definition
334
331
335
-
As before, suppose that the sample $w_1, \ldots, w_n$ has been sorted from
336
-
smallest to largest.
332
+
As before, suppose that the sample $w_1, \ldots, w_n$ has been sorted from smallest to largest.
337
333
338
334
The Gini coefficient is defined for the sample above as
339
335
@@ -377,8 +373,14 @@ ax.legend()
377
373
plt.show()
378
374
```
379
375
380
-
Another way to think of the Gini coefficient is as a ratio of the area between the 45-degree line of
381
-
perfect equality and the Lorenz curve (A) divided by the total area below the 45-degree line (A+B) as shown in {numref}`lorenz_gini2`.
376
+
In fact the Gini coefficient can also be expressed as
377
+
378
+
$$
379
+
G = \frac{A}{A+B}
380
+
$$
381
+
382
+
where $A$ is the area between the 45-degree line of
383
+
perfect equality and the Lorenz curve, while $B$ is the area below the Lorenze curve -- see {numref}`lorenz_gini2`.
382
384
383
385
```{code-cell} ipython3
384
386
---
@@ -403,11 +405,7 @@ ax.legend()
403
405
plt.show()
404
406
```
405
407
406
-
$$
407
-
G = \frac{A}{A+B}
408
-
$$
409
408
410
-
It is an average measure of deviation from the line of equality.
411
409
412
410
```{seealso}
413
411
The World in Data project has a [nice graphical exploration of the Lorenz curve and the Gini coefficient](https://ourworldindata.org/what-is-the-gini-coefficient)
@@ -417,7 +415,7 @@ The World in Data project has a [nice graphical exploration of the Lorenz curve
417
415
418
416
Let's examine the Gini coefficient in some simulations.
419
417
420
-
First the code below enables us to compute the Gini coefficient.
418
+
The code below computes the Gini coefficient from a sample.
421
419
422
420
```{code-cell} ipython3
423
421
@@ -521,9 +519,9 @@ wb.search("gini")
521
519
522
520
We now know the series ID is `SI.POV.GINI`.
523
521
524
-
Another, and often useful way to find series ID, is to use the [World Bank data portal](https://data.worldbank.org) and then use `wbgapi` to fetch the data.
522
+
(Anotherway to find the series ID is to use the [World Bank data portal](https://data.worldbank.org) and then use `wbgapi` to fetch the data.)
525
523
526
-
Using `pandas` we can take a quick look across all countries and all years in the World Bank dataset.
524
+
To get a quick overview, let's histogram Gini coefficients across all countries and all years in the World Bank dataset.
527
525
528
526
```{code-cell} ipython3
529
527
---
@@ -547,8 +545,7 @@ ax.set_ylabel("frequency")
547
545
plt.show()
548
546
```
549
547
550
-
We can see in {numref}`gini_histogram` that across 50 years of data and all countries
551
-
the measure only varies between 20 and 65.
548
+
We can see in {numref}`gini_histogram` that across 50 years of data and all countries the measure varies between 20 and 65.
**Note:** This package often returns data with year information contained in the columns. This is not always convenient for simple plotting with pandas so it can be useful to transpose the results before plotting
559
+
(This package often returns data with year information contained in the columns. This is not always convenient for simple plotting with pandas so it can be useful to transpose the results before plotting.)
560
+
563
561
564
562
```{code-cell} ipython3
565
563
data = data.T # Obtain years as rows
@@ -583,10 +581,8 @@ ax.set_xlabel("year")
583
581
plt.show()
584
582
```
585
583
586
-
As can be seen in {numref}`gini_usa1` the Gini coefficient:
587
-
588
-
1. trended upward from 1980 to 2020 and then dropped slightly following at the start of the COVID pandemic
589
-
2. moves slowly over time
584
+
As can be seen in {numref}`gini_usa1`, the income Gini
585
+
trended upward from 1980 to 2020 and then dropped following at the start of the COVID pandemic.
590
586
591
587
(compare-income-wealth-usa-over-time)=
592
588
### Gini coefficient for wealth (US data)
@@ -595,10 +591,9 @@ In the previous section we looked at the Gini coefficient for income using US da
595
591
596
592
Now let's look at the Gini coefficient for the distribution of wealth.
597
593
598
-
We can use the data collected above {ref}`survey of consumer finances <data:survey-consumer-finance>` to look at the Gini coefficient
594
+
We can use the {ref}`Survey of Consumer Finances data <data:survey-consumer-finance>` to look at the Gini coefficient
599
595
computed over the wealth distribution.
600
596
601
-
The Gini coefficient for net wealth and labour income is computed over many years.
0 commit comments