This project is to reproduce the first three charts in John Cassidy’s article Piketty’s Inequality Story in Six Charts. This article portrayed Thomas Piketty’s book, Capital in the Twenty-first Century, about rising income inequality.
The data of Piketty’s book is avaliable on public and I use ggplot2 to reproduce Cassidy’s charts.
library(readxl)
First_Chart <- read_excel("D:/AAEC8610/HW4/First Chart.xlsx")
Second_Chart <- read_excel("D:/AAEC8610/HW4/Second Chart.xlsx")
Third_Chart <- read_excel("D:/AAEC8610/HW4/Third Chart.xlsx")
library(ggplot2)
library(dplyr)
library(reshape2)
library(scales)
shading<-data.frame(First_Chart$Year,First_Chart$group1)
names(shading)[names(shading) == "First_Chart.Year"] <- "Year"
names(shading)[names(shading) == "First_Chart.group1"] <- "group1"
shading$col <- ifelse(shading$group1=="group1", 'white','cornsilk3')
This chart tracks the change of the share of total income taken by the top ten percentage of hourseholds in United States from 1910 to 2010. It surprisely shows that the share of the top decile climbed and kept in a high level during the Great Depression, lasting from 1929 to 1939. The share dropped sharply during the recovery of economic growth in 1940s. And it stayed stable from mid-fifties to mid seventies, where U.S. government expanded their spending on social programs and made a tax cut. Since 1980s, the share of the top decile continuly had a upward trend. Even after the financial crisis of 2007 to 2008, the share falled back a bit to 47%, it was still much higher than the records since 1928.
g<-ggplot(First_Chart,aes(Year,First_Chart$`Top 10% income share`))+
geom_rect(data=shading, aes(xmin = Year, xmax = dplyr::lead(Year), ymin = -Inf, ymax = Inf), fill = shading$col, show.legend=FALSE,
alpha=0.3) +
geom_line(size=1.2,color="coral2")+
labs(title="INCOME INEQUALITY IN THE UNITED STATES, 1910-2010",
y="SHARE OF TOP DECILE IN NATIONAL INCOME",
x ="" )+
scale_x_continuous(breaks=seq(1910,2010,10),expand=c(0,0))+
scale_y_continuous(breaks=seq(0.25,0.50,0.05),limits=c(0.25,0.50),expand=c(0,0),labels=percent_format(accuracy=1))+
theme_classic()+
theme(plot.title = element_text(family="Calibri", face="bold",size=10, hjust=0.5))+
theme(axis.title.y= element_text(family ="Calibri",face="bold",size=8,vjust=0.5,color="black"))+
theme(axis.ticks = element_blank(),axis.text.x = element_text(family="Calibri",color="black",size=8),axis.text.y = element_text(family="Calibri",face="bold",color="black",size=9))+
theme(axis.line = element_line(size=1, color = "black"))+
theme(plot.margin = unit(c(1,1.5,2,1.5),"cm"))
print(g)
It compares the income share of top 1% in three different forms: total income, capital gains and total wage bill.Interestingly, the top wage percnetile had not changed a lot from 1910 to 2010, and it fluctuated around 8% to 13%. The top percentile of total income and capital gains has a very similar trend. This might be accounted for the way that top 1% accumulate their wealth by capital—dividends, interest payments, and capital gains. Since they owned a lot of wealth, the they receive a lot of their income in this form.
Second_Chart1<- melt(Second_Chart,id.vars = "Year",value.name="Shares", variable.name="Cate")
g2<-ggplot()+
geom_rect(data=shading, aes(xmin = Year, xmax = dplyr::lead(Year), ymin = -Inf, ymax = Inf), fill = shading$col, show.legend=FALSE,
alpha=0.3)+
geom_line(data=Second_Chart1, aes(x=Year, y=Shares, group = Cate, color= Cate),size=1.2)+
scale_color_manual(values=c('#00CC99','#FFCC00','#CC3333'))+
labs(title="THE TRANSFORMATION OF THE TOP 1% IN THE UNITED STATES",
y="SHARE OF TOP PERCENTILE IN TOTAL (INCOME OR WAGES)",
x ="" )+
scale_x_continuous(breaks=seq(1910,2010,10),expand=c(0,0))+
scale_y_continuous(breaks=seq(0,0.24,0.02),limits=c(0,0.24),expand=c(0,0),labels=percent_format(accuracy=1))+
theme_classic()+
theme(plot.title = element_text(family="Mairy Black", face="bold",size=10, hjust=0.5))+
theme(axis.title.y= element_text(family ="Mairy Black",face="bold",size=8,vjust=0.5, color="black"))+
theme(axis.ticks = element_blank(),axis.text.x = element_text(family="Mairy Black",color="black",size=8),axis.text.y = element_text(family="Calibri",face="bold",color="black",size=9))+
theme(axis.line = element_line(size=1, color = "black"))+
theme(legend.text= element_text(face="bold",size=8))+
theme(legend.background = element_rect(fill= alpha("cornsilk3",0.3)))+
theme(legend.title = element_blank())+
theme(plot.margin = unit(c(1,1.5,2,1.5),"cm"))+
theme(legend.position = c(0.70,-0.213))+
theme(legend.box.margin = margin(1,0,1,0))+
guides(colour=guide_legend(override.aes = list(size=4,linetype=4)))
print(g2)
The author expanded his study to Canada, Australia and U.K. called “Anglo-Saxon countries”. All these countries show a U shape of the income share from top 1% people. Australia (the bottom green line) was a markedly equitable place comparing with other three countries, keeping its share lower than 12%. And we can find that the level of inequality in the United States has been a upward trend since 1970s, and it was highest among all countries since 1990s.
#Third Chart
Third_Chart1<- melt(Third_Chart,id.vars = "Year",value.name="Shares", variable.name="Country")
g3<-ggplot() +
geom_rect(data=shading, aes(xmin = Year, xmax = dplyr::lead(Year), ymin = -Inf, ymax = Inf), fill = shading$col, show.legend = FALSE,
alpha=0.3)+
geom_line(data=Third_Chart1, aes(x=Year, y=Shares, group = Country, color= Country),size=1.2)+
scale_color_manual(values=c('#333333','#0000FF','#33CCFF','#339933'))+
labs(title="INCOME INEQUALITY IN ANGLO-SAXON COUNTRIES, 1910-2010",
y="SHARE OF TOP PERCENTILE IN NATIONAL INCOME",
x ="" )+
scale_x_continuous(breaks=seq(1910,2010,10),expand=c(0,0))+
scale_y_continuous(breaks=seq(0,0.24,0.02),limits=c(0,0.24),expand=c(0,0),labels=percent_format(accuracy=1))+
theme_classic()+
theme(plot.title = element_text(family="Times", face="bold",size=10, hjust=0.5))+
theme(axis.title.y= element_text(family ="Times",face="bold",size=8,vjust=0.5, color="black"))+
theme(axis.ticks = element_blank(),axis.text.x = element_text(family="Times",color="black",size=8),axis.text.y = element_text(family="Calibri",face="bold",color="black",size=9))+
theme(axis.line = element_line(size=1, color = "black"))+
theme(legend.text= element_text(face="bold",size=8))+
theme(legend.background = element_rect(fill=alpha("cornsilk3",0.3)))+
theme(legend.title = element_blank())+
theme(plot.margin = unit(c(1,1.5,2.4,1.5),"cm"))+
theme(legend.position = c(0.77,-0.25))+
guides(col =guide_legend(nrow =2),colour=guide_legend(override.aes = list(size=4,linetype=4)))
print(g3)
*Piketty, T., 2014. Capital in the 21st Century.
*Cassidy, J., 2014. Piketty’s inequality story in six charts. The New Yorker, 26.