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
Another way to think of the Gini coefficient is as a ratio of the area between the 45-degree line of
382
-
perfect equality and the Lorenz curve (A) divided by the total area below the 45-degree line (A+B).
383
-
384
-
```{seealso}
385
-
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])
386
-
```
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`.
387
382
388
383
```{code-cell} ipython3
389
384
---
@@ -402,8 +397,8 @@ ax.set_ylim((0, 1))
402
397
ax.set_xlim((0, 1))
403
398
ax.text(0.55, 0.4, 'A')
404
399
ax.text(0.75, 0.15, 'B')
405
-
ax.set_xlabel("household percentile")
406
-
ax.set_ylabel("income/wealth percentile")
400
+
ax.set_xlabel("share of households (%)")
401
+
ax.set_ylabel("share of income/wealth (%)")
407
402
ax.legend()
408
403
plt.show()
409
404
```
@@ -414,6 +409,10 @@ $$
414
409
415
410
It is an average measure of deviation from the line of equality.
416
411
412
+
```{seealso}
413
+
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])
414
+
```
415
+
417
416
### Gini coefficient of simulated data
418
417
419
418
Let's examine the Gini coefficient in some simulations.
@@ -463,10 +462,8 @@ In each case we set $\mu = - \sigma^2 / 2$.
463
462
464
463
This implies that the mean of the distribution does not change with $\sigma$.
465
464
466
-
```{note}
467
465
You can check this by looking up the expression for the mean of a lognormal
The plots show that inequality rises with $\sigma$, according to the Gini
512
509
coefficient.
513
510
514
-
### Gini coefficient dynamics for US data (income)
511
+
### Gini coefficient for US data (income)
515
512
516
513
Now let's look at the Gini coefficient using US data.
517
514
518
-
We will get pre-computed Gini coefficients from the World Bank using the [wbgapi](https://blogs.worldbank.org/opendata/introducing-wbgapi-new-python-package-accessing-world-bank-data).
515
+
We will get pre-computed Gini coefficients (based on income) from the World Bank using the [wbgapi](https://blogs.worldbank.org/opendata/introducing-wbgapi-new-python-package-accessing-world-bank-data).
519
516
520
517
Let's use the `wbgapi` package we imported earlier to search the world bank data for Gini to find the Series ID.
{numref}`gini_usa_trend` shows inequality was falling in the USA until 1981 when it appears to have started to change course and steadily rise over time.
599
+
{numref}`gini_usa_trend` shows inequality was falling in the USA until 1980 when it appears to have started to change course and steadily rise over time.
638
600
639
601
(compare-income-wealth-usa-over-time)=
640
602
### Comparing income and wealth inequality (the US case)
@@ -766,7 +728,7 @@ The wealth time series exhibits a strong U-shape.
766
728
767
729
As we saw earlier in this lecture we used `wbgapi` to get Gini data across many countries and saved it in a variable called `gini_all`
768
730
769
-
In this section we will compare a few countries and the evolution in their respective Gini coefficients
731
+
In this section we will compare a few western economies and look at the evolution in their respective Gini coefficients
770
732
771
733
```{code-cell} ipython3
772
734
data = gini_all.unstack() # Obtain data for all countries as a table
@@ -778,7 +740,11 @@ There are 167 countries represented in this dataset.
778
740
Let us compare three western economies: USA, United Kingdom, and Norway
0 commit comments