3. Analysis of Data Quality
1. Public opinion data.
We first look at the public opinion data. This data was sourced from the AEI Public Opinion Study. It tracks the year on year public opinion about global warming. We look data for the years 1989 through 2015. The people surveyed for this data were asked the question “How much of a threat do you think Global warming poses?” The answers were classified as “Fair Amount”, “Great Deal”, “not at all” and “only a little”
As we can see that there are a few missing values for the years 1992-96 and the year 2005. Also, there might be some faults in the data in terms of consistency. The data is supposed to show the percentage of each response. Thus, ideally it should sum to 100. However, in some cases it does not sum to 100. We speculate that there was an error in recording the data or perhaps some of the respondents refused to answer the question.
library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
library(plyr)
data <- read_excel("global warming and climate change.xlsx")
new_data <- gather(data, "Perception", "Percentage", 2:5)
graph <- ggplot() + geom_bar(aes(y = Percentage, x = Year, fill = Perception), data = new_data, stat="identity")+scale_x_continuous(breaks=seq(1989,2016,1))+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 14, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10, angle = 60, hjust =1),
axis.text.y=element_text(colour="black", size = 10))
graph

2. Credit Card Debt per Household
Here we chose to look at the credit card debt per household as an estimate of a rising consumerist lifestyle promoted by free market capitalism. We hyposthesize that the surplus of mass produced goods in the free market economy gives impetus to increased wanton consumption. This increased consumption of inexpensive material goods is correlated with a sharp rise in CO2 emissions. We hope to explore this relationship with this data.
An interesting observation we make is the spike in debt at the peak of the economic recession in 2008.
library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
credit <- read_excel("credit card debt by household.xlsx")
g <- ggplot(credit, aes(Year_Q4,Per_Household_Debt))+geom_line(color = "green")+
ggtitle("Household Credit Card Debt")+
theme_grey(16)+xlab("Year")+ylab("Credit card debt in USD")
theme(legend.title = element_blank())
## List of 1
## $ legend.title: list()
## ..- attr(*, "class")= chr [1:2] "element_blank" "element"
## - attr(*, "class")= chr [1:2] "theme" "gg"
## - attr(*, "complete")= logi FALSE
## - attr(*, "validate")= logi TRUE
g

3. Atmospheric CO2 content
For this data we look at the measured concentration of CO2 in the earth’s atmosphere for the years 1988 through 2015
library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
credit <- read_excel("Emissions.xlsx")
g <- ggplot(credit, aes(Year,CO2_ppm))+geom_line(color="blue")+
ggtitle("Atmospheric CO2 Content")+
theme_grey(16)+
theme(legend.title = element_blank())
g

4. Temperature Data
For the temperature plots we have taken the GLOBAL LAND-OCEAN TEMPERATURE INDEX compiled by NASA’s Goddard Institute for Space Studies. It illustrates the change in global temperature relative to a certain baseline (average for the years 1951-1980).
library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
credit <- read_excel("Temperature.xlsx")
g <- ggplot(credit, aes(Year,Temp))+geom_line(color="red")+
ggtitle("Temperature Index")+
theme_grey(16)+
theme(legend.title = element_blank())
g

4. Main Analysis (Exploratory Data Analysis)
A major chunk of the project was dedicated to gathering the right kind of data to answer the questions we wish to answer. To this end we ran literature survey of the references provide by Klein in her book that supposedly support her claims.
Firstly, we would like to present a timeline beginning on 1988 that virtually marks an epoch:
1988 : Goddard Institute presents definitive link between rising global temperature and unfettered release of CO2 into the atmosphere stemming from human activity
1989 : IPCC (Intergovernmental Panel for Climate Change) is formed.
Fall of the Communist Bloc
1992 : UN Climate Convention at Rio NAFTA is ratified
1994 : WTO is born
1997 : Kyoto Protocol is ratified
2008 : Housing crisis
2011 : Warmest year on record
2013 : TPP is ratified in secret
2014 : Green Economy Act, Canada
2015 : Paris Agreement
An interactive timeline for this information is given below.
library(timevis)
data <- data.frame(
id = 1:13,
content = c("IPCC formed, first session", "Goddard Institute presents in Congress",
"Fall of the Communist Bloc", "First IPCC negotiations", "UN Climate Convention in Rio", "WTO is formed", "Kyoto protocol", "Housing Crisis", "Warmest year on record", "WTO deems China's subsidy of solar panels illegal", "TPP is ratified", "Green Economy Act, Canada", "Paris Agreement"),
start = c("1989", "1988",
"1989", "1989","1992","1994","1997","2008","2011","2012","2013","2014","2015"),
end = c(NA, NA, NA, NA,NA, NA, NA, NA,NA, NA, NA, NA,NA)
)
timevis(data)
We want to investigate the following claim(s) made in the book with data:
The rise of free market capitalism at the end of the Cold War led to the proliferation of free market capitalism throughout the world. The author claims that the free market ideology which presupposes infinite growth at the cost of rising consumption is fundamentally at loggerheads with actions that combat climate change. She supports this claim by pointing out that since 1988 when the first climate negotiations began, the CO2 emissions have actually grown at an unprecedented rate.
To dig deeper into the causes for this we observe that almost every landmark climate negotiation is often countered with a free trade agreement. For example, the WTO in 2012 prevented China from exporting subsidized solar panels since it amounted to “unfair trade practices”. This was high on the heels of 2011 which was the warmest year on record.
Additionally, the author claims that by outsourcing the manufacturing to the developing world (India, China, Brazil etc.) where environmental laws are lax or sometimes nonexistent has led to cheaper mass produced goods. These goods are manufactured with at a massive cost to the environment. Moreover, transporting these goods across long distances in diesel shipment trawlers contributes massively to global CO2 emissions. Also, the availability of such inexpensive goods on a massive scale has lead to a highly consumerist lifestyle.
To verify these claims we chose to look at household credit card debt to estimate the rising consumerism, the global surface temperature index and atmospheric CO2 content. On the public policy front, certain vested interests that profit from fossil fuels have been actively discrediting climate science. To gauge this we decided to look at public perception of climate change.
Our methodology was as follows:
We take the greenhouse effect caused by CO2 as a baseline starting point. Therefore, atmospheric CO2 content becomes the prime variable we test our hypothesis against. This means that if we find enough evidence that suggests a particular parameter causes rise in CO2 emissions we will accept the corresponding claim as verified.
To this end, we first check correlations between CO2 emissions and the different socio-economic parameters that we are looking at. Look at their distributions
Check the effect of each parameter individually against CO2 emissions
library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
library(GGally)
data <- read_excel("raw_data.xlsx")
data<-data[c(12:28),c(2:5)]
ggpairs(data)

library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
data <- read_excel("raw_data.xlsx")
new_data <- data[c(12:28),]
ggplot(data, aes(x=CO2_ppm, y=Temp)) + geom_point(color = "cyan4", size = 2)+
ggtitle("Scatterplot between Atmospheric CO2 Content & Temperature Index")+
xlab("Atmospheric CO2 Content")+ylab("Temperature Index")+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 12, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10),
axis.text.y=element_text(colour="black", size = 10))

ggplot(new_data, aes(x=CO2_ppm, y=Per_Household_Debt)) + geom_point(color = "cyan4", size = 2)+
ggtitle("Scatterplot between Atmospheric CO2 Content & Per_Household_Debt")+
xlab("Atmospheric CO2 Content")+ylab("Per_Household_Debt")+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 12, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10),
axis.text.y=element_text(colour="black", size = 10))

ggplot(new_data, aes(x=CO2_ppm, y=Perception)) + geom_point(color = "cyan4", size = 2)+
ggtitle("Scatterplot between Atmospheric CO2 Content & Perception")+
xlab("Atmospheric CO2 Content")+ylab("Perception")+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 12, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10),
axis.text.y=element_text(colour="black", size = 10))

Inferences
From the scatter plots we see that the strong correlation between atmospheric CO2 and temperature index as we had expected from our baseline assumption about the greenhouse effect.
Counterintuitively, public opinion on the threat that climate change poses seems to have diminished against the backdrop of rising global temperatures. A larger percentage of people now believe that climate change is not such a serious threat.
There is a fairly strong correlation between credit card debt (adjusted for inflation) which here we are using to estimate hyperconsumption and CO2 levels.
Finally we plot the collective effect of these three parameters on CO2 levels in a consolidated graph:
We scaled and normalized the data to the same standard in order to see the relative trends of each feature compared to others. We scaled the data so that the line plots of the variables will start at the same point. We substitute missing values in Preception Index with 0s.
library(ggplot2)
# 1988-2015 data
#credit card debt 99-15
data2 = read.csv("Debt.csv", header = T)
# perception 89-15
data3 = read.csv("Perception.csv", header = T)
# global temperature change 88-15
data5 = read.csv("Temperature.csv", header = T)
# CO2 Emission change
data1 = read.csv("Emissions.csv", header = T)
data = read.csv("Climate.csv", header = T)
for (i in 1:28){
data$Temp[i] = data$Temp[i] * 700 /200
}
for (i in 1:28){
data$CO2_ppm[i]=data$CO2_ppm[i]/200
}
for (i in 11:28){
data$Debt[i]=data$Debt[i]/21.14/200
}
for (i in 2:28){
data$Perception.Not.at.all.[i]=data$Perception.Not.at.all.[i]*16.3/200
}
write.csv(data, file = "climate_scaled.csv")
library(reshape2)
##
## Attaching package: 'reshape2'
## The following object is masked from 'package:tidyr':
##
## smiths
dd = melt(data, id=c("Year"))
ggplot(dd) + geom_line(aes(x=Year, y=value, colour=variable)) +
scale_colour_manual(values=c("red","green","blue", "orange")) +ggtitle("Plot of the Four Indexes")

5. Executive Summary
To summarize we first look at the raw data we have selected. Namely, public opinion on global warming, CO2 in the atmosphere, credit card debt per household and global surface temperature index. The plots presented earlier are tidied up.
library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
library(plyr)
data <- read_excel("global warming and climate change.xlsx")
new_data <- gather(data, "Perception", "Percentage", 2:5)
graph <- ggplot() + geom_bar(aes(y = Percentage, x = Year, fill = Perception), data = new_data, stat="identity")+scale_x_continuous(breaks=seq(1989,2016,1))+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 14, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10, angle = 60, hjust =1),
axis.text.y=element_text(colour="black", size = 10))
graph

library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
credit <- read_excel("credit card debt by household.xlsx")
g <- ggplot(credit, aes(Year_Q4,Per_Household_Debt))+geom_line(color = "cornflowerblue",lwd=1.1)+
geom_point(color = "cornflowerblue", size = 2)+
scale_x_continuous(breaks=seq(1999,2015,1))+
ggtitle("Household Credit Card Debt")+
xlab("Year")+ylab("Credit card debt in USD")+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 14, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10, angle = 60, hjust =1),
axis.text.y=element_text(colour="black", size = 10))
g

library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
emi <- read_excel("Emissions.xlsx")
g <- ggplot(emi, aes(Year,CO2_ppm))+geom_line(color = "cornflowerblue",lwd=1.1)+
geom_point(color = "cornflowerblue", size = 2)+
scale_x_continuous(breaks=seq(1988,2015,1))+
ggtitle("Atmospheric CO2 Content")+
xlab("Year")+ylab("CO2_ppm")+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 14, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10, angle = 60, hjust =1),
axis.text.y=element_text(colour="black", size = 10))
g

library(dplyr)
library(ggplot2)
library(tidyverse)
library(readxl)
temp <- read_excel("Temperature.xlsx")
g <- ggplot(temp, aes(Year,Temp))+geom_line(color = "cornflowerblue",lwd=1.1)+
geom_point(color = "cornflowerblue", size = 2)+
scale_x_continuous(breaks=seq(1988,2015,1))+
ggtitle("Temperature Index")+
xlab("Year")+ylab("Temperature Index")+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 14, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 10, angle = 60, hjust =1),
axis.text.y=element_text(colour="black", size = 10))
g

(From the main analysis section)
We want to investigate the following claim(s) made in the book with data:
The rise of free market capitalism at the end of the Cold War led to the proliferation of free market capitalism throughout the world. The author claims that the free market ideology which presupposes infinite growth at the cost of rising consumption is fundamentally at loggerheads with actions that combat climate change. She supports this claim by pointing out that since 1988 when the first climate negotiations began, the CO2 emissions have actually grown at an unprecedented rate.
To dig deeper into the causes for this we observe that almost every landmark climate negotiation is often countered with a free trade agreement. For example, the WTO in 2012 prevented China from exporting subsidized solar panels since it amounted to “unfair trade practices”. This was high on the heels of 2011 which was the warmest year on record.
Additionally, the author claims that by outsourcing the manufacturing to the developing world (India, China, Brazil etc.) where environmental laws are lax or sometimes nonexistent has led to cheaper mass produced goods. These goods are manufactured with at a massive cost to the environment. Moreover, transporting these goods across long distances in diesel shipment trawlers contributes massively to global CO2 emissions. Also, the availability of such inexpensive goods on a massive scale has lead to a highly consumerist lifestyle.
To verify these claims we chose to look at household credit card debt to estimate the rising consumerism, the global surface temperature index and atmospheric CO2 content. On the public policy front, certain vested interests that profit from fossil fuels have been actively discrediting climate science. To gauge this we decided to look at public perception of climate change.
library(ggplot2)
# 1988-2015 data
#credit card debt 99-15
data2 = read.csv("Debt.csv", header = T)
# perception 89-15
data3 = read.csv("Perception.csv", header = T)
# global temperature change 88-15
data5 = read.csv("Temperature.csv", header = T)
# CO2 Emission change
data1 = read.csv("Emissions.csv", header = T)
data = read.csv("Climate.csv", header = T)
for (i in 1:28){
data$Temp[i] = data$Temp[i] * 700 /200
}
for (i in 1:28){
data$CO2_ppm[i]=data$CO2_ppm[i]/200
}
for (i in 11:28){
data$Debt[i]=data$Debt[i]/21.14/200
}
for (i in 2:28){
data$Perception[i]=data$Perception.Not.at.all.[i]*16.3/200
}
data = data[,c(1:4, 6)]
write.csv(data, file = "climate_scaled.csv")
library(reshape2)
dd = melt(data, id=c("Year"))
ggplot(dd) + geom_line(aes(x=Year, y=value, colour=variable)) +
scale_colour_manual(values=c("red","green","blue", "orange")) +ggtitle("Plot of the Four Indices")+
xlab("Year")+ylab("Data")+
scale_x_continuous(breaks=seq(1988,2015,1))+
theme(axis.line = element_line(size=1, colour = "black"),
panel.grid.major = element_line(colour = "#d3d3d3"), panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank()) +
theme(plot.title = element_text(size = 30, family = "Tahoma", face = "bold"),
text=element_text(family="Tahoma"),
axis.text.x=element_text(colour="black", size = 20, angle = 60, hjust =1),
axis.text.y=element_text(colour="black", size = 20),
axis.title.x=element_text(size=20,face="bold"),
axis.title.y=element_text(size=20,face="bold"),
legend.text=element_text(size=18,face="bold"),
legend.title=element_text(size=20,face="bold"))
