Skip to content

Commit 059eaf6

Browse files
committed
update gini to Gini
1 parent 976f16b commit 059eaf6

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

lectures/inequality.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ Now let's look at the Gini coefficient using US data.
519519
520520
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).
521521
522-
Let's use the `wbgapi` package we imported earlier to search the world bank data for gini to find the Series ID.
522+
Let's use the `wbgapi` package we imported earlier to search the world bank data for Gini to find the Series ID.
523523
524524
```{code-cell} ipython3
525525
wb.search("gini")
@@ -562,7 +562,7 @@ ax.set_ylim(0,data_usa.max()+5)
562562
plt.show()
563563
```
564564
565-
As can be seen in {numref}`gini_usa1` the gini coefficient:
565+
As can be seen in {numref}`gini_usa1` the Gini coefficient:
566566
567567
1. moves slowly over time, and
568568
2. does not have significant variation in the full range from 0 to 100.
@@ -631,11 +631,10 @@ y = data_usa.dropna().values
631631
plt.scatter(x,y)
632632
plt.plot(x1, a1*x1+b1)
633633
plt.plot(x2, a2*x2+b2)
634-
plt.title("USA gini coefficient dynamics")
634+
plt.title("US Gini coefficient dynamics")
635635
plt.legend(['Gini coefficient', 'Trend (before 1981)', 'Trend (after 1981)'])
636-
plt.ylim(25,45)
637636
plt.ylabel("Gini coefficient")
638-
plt.xlabel("Year")
637+
plt.xlabel("year")
639638
plt.show()
640639
```
641640
@@ -646,7 +645,7 @@ plt.show()
646645
647646
As we have discussed the Gini coefficient can also be computed over different distributions such as *income* and *wealth*.
648647
649-
We can use the data collected above {ref}`survey of consumer finances <data:survey-consumer-finance>` to look at the gini coefficient when using income when compared to wealth data.
648+
We can use the data collected above {ref}`survey of consumer finances <data:survey-consumer-finance>` to look at the Gini coefficient when using income when compared to wealth data.
650649
651650
We can compute the Gini coefficient for net wealth, total income, and labour income over many years.
652651
@@ -704,7 +703,7 @@ ginis.head(n=5)
704703
705704
Let's plot the Gini coefficients for net wealth, labor income and total income.
706705
707-
Looking at each data series we see an outlier in gini coefficient computed for 1965 for `labour income`.
706+
Looking at each data series we see an outlier in Gini coefficient computed for 1965 for `labour income`.
708707
709708
We will smooth our data and take an average of the data either side of it for the time being.
710709
@@ -770,9 +769,9 @@ The wealth time series exhibits a strong U-shape.
770769
771770
### Cross-country comparisons of income inequality
772771
773-
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`
772+
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`
774773
775-
In this section we will compare a few countries and the evolution in their respective gini coefficients
774+
In this section we will compare a few countries and the evolution in their respective Gini coefficients
776775
777776
```{code-cell} ipython3
778777
data = gini_all.unstack() # Obtain data for all countries as a table
@@ -802,9 +801,9 @@ data['NOR'] = data['NOR'].ffill()
802801
data[['USA','GBR', 'NOR']].plot(ylabel='gini coefficient')
803802
```
804803
805-
From this plot we can observe that the USA has a higher gini coefficient (i.e. higher income inequality) when compared to the UK and Norway.
804+
From this plot we can observe that the USA has a higher Gini coefficient (i.e. higher income inequality) when compared to the UK and Norway.
806805
807-
Norway has the lowest gini coefficient over the three economies from the year 2003, and it is consistently substantially lower than the USA.
806+
Norway has the lowest Gini coefficient over the three economies from the year 2003, and it is consistently substantially lower than the USA.
808807
809808
### Gini Coefficient and GDP per capita (over time)
810809
@@ -817,7 +816,7 @@ countries = ['USA', 'NOR', 'GBR']
817816
gdppc = wb.data.DataFrame("NY.GDP.PCAP.KD", countries).T
818817
```
819818
820-
We can rearrange the data so that we can plot gdp per capita and the gini coefficient across years
819+
We can rearrange the data so that we can plot gdp per capita and the Gini coefficient across years
821820
822821
```{code-cell} ipython3
823822
plot_data = pd.DataFrame(data[countries].unstack())
@@ -841,7 +840,7 @@ We will transform the year column to remove the 'YR' text and return an integer.
841840
plot_data.year = plot_data.year.map(lambda x: int(x.replace('YR','')))
842841
```
843842
844-
Now using plotly to build a plot with gdp per capita on the y-axis and the gini coefficient on the x-axis.
843+
Now using plotly to build a plot with gdp per capita on the y-axis and the Gini coefficient on the x-axis.
845844
846845
```{code-cell} ipython3
847846
min_year = plot_data.year.min()
@@ -872,7 +871,7 @@ fig.show()
872871
```
873872
874873
This plot shows that all three western economies gdp per capita has grown over time with some fluctuations
875-
in the gini coefficient. However the appears to be significant structural differences between Norway and the USA.
874+
in the Gini coefficient. However the appears to be significant structural differences between Norway and the USA.
876875
877876
## Top shares
878877

0 commit comments

Comments
 (0)