TB DACSS 601 Final Project

An exploration of fossil fuel dependent countries and preparedness for a post-fossil fuel economy.

Tory Bartelloni
05/14/2022

Introduction

This analysis will focus on an important question related to sustainability: Are fossil fuel dependent countries preparing for a post-fossil fuel world?

Over the past two centuries our world has become extremely energy intensive and dependent on fossil fuels to produce that energy. The widespread use of fossil fuels is largely due to its efficiency and availability. Compared to previous energy production techniques fossil fuels produce larger amounts of output with the same amount of input, making it valuable in increasing economic output of products and technologies that improve the quality of life for people across the world. Additionally, at current we are able to extract and use these resources relatively easily (and increasingly so) while continuing to find more reserves and ways to extract previously unreachable resources.

With these advantages it is no surprise that in 2014 the BP Statistical Review of World Energy estimated that 86.3% of world energy consumption was from fossil fuels and that between 1989 and 2014 energy consumption grew by 60%, with fossil fuel consumption rising at the same rate (BP Statistical Review, 2015).

With that said, there is a reason we raise this question. It is estimated that there is currently 41 years worth of confirmed oil reserves if we continue to consume at our current rate (Worldometer, 2022). This could be supplemented by natural gas and coal, which in an ideal scenarios could extend that timeline to about 127 years at current consumption rates. With, optimistically, four generations and, pessimistically, only one generation of fossil fuels remaining it becomes important to visit the question of preparing for a post-fossil fuel world.

The importance of this question is grounded in premises and assumptions that I feel are critical to state before delving into the topic.

Premises and Assumptions

Set 1:

  1. Fossil fuel resources are finite and non-renewable.
  2. Energy resources are a critical component to economic health.
  3. It will take concerted effort to replace fossil fuel energy production in the estimated time-frame of availability.

Therefore, focusing on fossil fuel production exclusively is not a long term option for sustainable economic health.

Set 2:

  1. GDP and GDP per capita are important indicators for the health of a economy.
  2. The health of an economy is an important component to the quality of life of persons within that economy.
  3. The health of an economy is an important component to the overall sustainability and cohesion of a society.
  4. Social stability and quality of life are worthy aspirations.

Therefore, the overall health of an economy as measured by GDP per capita can be used as an indicator of the sustainability of a society and ability for that society to provide a good quality of life for persons within that society.

Conclusion:

A reduction in fossil fuel production/use with an accompanying increase in the use of other energy sources and/or other economic activity would indicate the transition to a more sustainable economy.

The Data

In order to answer this question we will use data taken from the World Bank’s database of World Development Indicators (World Bank, 2022). The specific data we have are using includes annual statistics on energy production and economic activity. The primary indicators we will be using are Natural Resource Rents and Electricity Production from Fossil Fuels.

Let’s start by defining our key variables in the initial and/or final form that they are used during this analysis.

  1. Country Name - factor - This is the name of the country that the observation applies to.

  2. GDP (current US$) - numeric - The country’s Gross Domestic Product in current US dollars.

  3. Natural Resource Rents (% of GDP) - numeric - Natural resource rents describe the difference between the value of production at world prices and their total costs of production, or roughly the portion of GDP that the production of natural resources makes up. This is broken down into several categories including: oil, gas, coal, forests, and minerals. During the analysis we create a “fossil fuel rents” variable from oil, gas, and coal rents.

  4. Electricity production from oil, gas and coal sources (% of total) - numeric - The percentage of total electricity produced by the country that was produced by oil, gas, or coal sources.

  5. Commercial/merchandise service exports (current US$) = numeric - The total amount of commercial service or merchandise exports in current US dollars. (two separate variables) During the analysis we create a net-import value for each of commercial services and merchandise from the two above variables (imports-exports).

  6. Commercial/merchandise service imports (current US$) - numeric - The total amount of commercial service or merchandise imports in current US dollars. (two separate variables) During the analysis we create a net-import value for each of commercial services and merchandise from the two above variables (imports-exports).

  7. Energy imports, net (% of energy use) - numeric - Net energy imports are estimated as energy use less production, both measured in oil equivalents. A negative value indicates that the country is a net exporter.

Preparing the Data

The data set came to us in a largely unusable form and with a number of variables and observations that we have chosen not to use. I will not go in to detail, but I will leave the code here if you desire to see how we got to our final data set.

As a summary, we had to pivot the data longer then pivot the data wider, rename the columns, convert columns to appropriate data types, add custom columns, and finally select only the columns of interest.

Show code
# Pivot years to be a single column
# Remove observations that have no data
long_pivot_world_bank_data <- world_bank_data %>% 
  select(-`Series Name`,-`Country Code`) %>%
  pivot_longer("1970 [YR1970]":"2020 [YR2020]",
               names_to = "Year",
               names_transform = list(Year=parse_number),
               values_to = "Value") %>%
  filter(Value != "..")


# Pivot wider so that each variable (series) is a column
wide_pivot_world_bank_data <- long_pivot_world_bank_data %>%
  pivot_wider(names_from=c(`Series Code`),
              values_from = Value)


# Rename columns for easier reference
wide_pivot_world_bank_data <- wide_pivot_world_bank_data %>%
  rename(
    Country = `Country Name`,
    ECO_Dev_Assist_IN = DT.ODA.ALLD.CD,
    EDU_Bach_Pop = SE.TER.CUAT.BA.ZS,
    Crop_Production_Index = AG.PRD.CROP.XD,
    LND_Agri_Perc = AG.LND.AGRI.ZS,
    LND_Agri_KM2 = AG.LND.AGRI.K2,
    ENV_Disaster_Ind = EN.CLC.MDAT.ZS,
    LND_Below_5M = AG.LND.EL5M.ZS,
    POP_Total = SP.POP.TOTL,
    POP_65_and_Up = SP.POP.65UP.TO,
    POP_0_to_14 = SP.POP.0014.TO,
    ECON_Export_Commercial = TX.VAL.SERV.CD.WT,
    ECON_Export_Merchandise = TX.VAL.MRCH.CD.WT,
    ECON_Import_Commercial = TM.VAL.SERV.CD.WT,
    ECON_Import_Merchandise = TM.VAL.MRCH.CD.WT,
    POV_MD_Pov_Index = SI.POV.MDIM.XQ,
    GDP_Per_Capita = NY.GDP.PCAP.CD,
    GDP = NY.GDP.MKTP.CD,
    NAT_Coal_Rents = NY.GDP.COAL.RT.ZS,
    NAT_Forest_Rents = NY.GDP.FRST.RT.ZS,
    NAT_Mineral_Rents = NY.GDP.MINR.RT.ZS,
    NAT_Natural_Gas_Rents = NY.GDP.NGAS.RT.ZS,
    NAT_Oil_Rents = NY.GDP.PETR.RT.ZS,
    Imports_Energy = EG.IMP.CONS.ZS,
    ELE_Prod_Fossil_Fuels = EG.ELC.FOSL.ZS,
    ELE_Prod_Renewable = EG.ELC.RNWX.ZS,
  )

# convert the columns to the appropriate classes
wide_pivot_world_bank_data <- wide_pivot_world_bank_data %>%
  mutate(across(c(3:ncol(wide_pivot_world_bank_data)), as.numeric),
         across(1, as.factor))

# Create lists denoting if the country is part of the UN Economic and Social Council or OPEC, and if it is in the data, but not a country
unecosoc_countries <- c("Afghanistan","Argentina","Austria","Bangladesh","Belgium",
                        "Belize","Benin","Bolivia","Botswana","Bulgaria","Canada",
                        "Chile","China","Colombia","Congo, Dem. Rep.","Côte d’Ivoire","Croatia",
                        "Czechia","Denmark","Eswatini","Finland","France","Gabon","Greece",
                        "Guatemala","India","Indonesia","Israel","Italy","Japan","Kazakhstan",
                        "Latvia","Liberia","Libya","Madagascar","Mauritius","Mexico","Montenegro",
                        "New Zealand","Nicaragua","Nigeria","Oman","Panama","Peru",
                        "Portugal","Republic of Korea","Russian Federation","Solomon Islands",
                        "Thailand","Tunisia","United Kingdom","United Republic of Tanzania",
                        "United States","Zimbabwe")

opec_countries <- c("Algeria", "Angola", "Congo, Dem. Rep.", "Equatorial Guinea",
                    "Gabon", "Iran, Islamic Rep.", "Kuwait", "Libya", "Nigeria",
                    "Saudi Arabia", "United Arab Emirates", "Venezuela, RB")

non_countries <- world_bank_data[6602:6650,1]

# Adding columns for FF rents, commercial and merchandise imports, 
wide_pivot_world_bank_data <- wide_pivot_world_bank_data %>%
  filter(Country %notin% non_countries$`Country Name`) %>%
  mutate(NAT_Fossil_Fuel_Rents = NAT_Coal_Rents + NAT_Natural_Gas_Rents + NAT_Oil_Rents,
         UN_Eco_Soc = if_else(Country %in% unecosoc_countries, "Yes", "No"),
         OPEC = if_else(Country %in% opec_countries, "Yes", "No"),
         Imports_Commercial =  ECON_Import_Commercial -  ECON_Export_Commercial,
         Imports_Merchandise = ECON_Import_Merchandise - ECON_Export_Merchandise
         ) %>%
  select(
    Country,
    Year,
    GDP,
    GDP_Per_Capita,
    ELE_Prod_Fossil_Fuels,    
    NAT_Fossil_Fuel_Rents,
    NAT_Forest_Rents,
    NAT_Mineral_Rents,
    Imports_Commercial,
    Imports_Merchandise,
    Imports_Energy,
    UN_Eco_Soc,
    OPEC
  )

After the transformations and when we begin our analysis it looks like this:

Show code
rmarkdown::paged_table(head(wide_pivot_world_bank_data))

What I want to stress in this section is a decision made to limit the scope of the analysis. To be able to answer our question we need to focus on dependent countries and we need to be able to see change over time.

We first choose 1990 as the year to assess dependence in recognition of the first year Earth Day was celebrated internationally and to give us ample time (25-30 years) to assess changes in our variables of interest (Lewis, 1990).

Secondly, we will focus only on two extremes. Taking from the 1990 data we will choose countries that were either dependent on fossil fuel production for electricity or who were dependent on it for large portions of their economic activity. Both groups will be determined by taking observations that are in the 85th percentile or higher based on:

Electricity Dependence: The portion of total electricity produce by fossil fuels. The 85th percentile is 99.14% of toal electricity produced.

Economic Dependence: Sum of Rents from Fossil Fuels (oil, gas, and coal). The 85th percentile is 10.15% of GDP due to fossil fuel production.

The final data set looks like this:

Show code
High_Renters <- wide_pivot_world_bank_data %>%
  filter(Year == 1990, NAT_Fossil_Fuel_Rents >= 
           quantile(filter(wide_pivot_world_bank_data, Year == 1990) %>%
                      select(NAT_Fossil_Fuel_Rents), 
                    .85, 
                    na.rm=TRUE))

Dependents <- wide_pivot_world_bank_data %>%
  filter(Year == 1990, ELE_Prod_Fossil_Fuels >=
           quantile(filter(wide_pivot_world_bank_data, Year == 1990) %>%
                      select(ELE_Prod_Fossil_Fuels), 
                    .85, 
                    na.rm=TRUE))

CS <- tibble(c(Dependents$Country, High_Renters$Country)) %>% 
  rename(Country =   `c(Dependents$Country, High_Renters$Country)`)

Both <- CS %>% group_by(Country) %>%
  summarise(Count = n()) %>%
  filter(Count == 2)

wide_pivot_world_bank_data <- wide_pivot_world_bank_data %>%
  mutate(FF_Status_1990 =
           case_when(
             Country %in% Both$Country ~ "Both",
             Country %in% High_Renters$Country ~ "Economic",
             Country %in% Dependents$Country ~ "Electric"
             )
         )

final_world_bank_data <- wide_pivot_world_bank_data %>%
  filter(!is.na(FF_Status_1990), Year > 1989)

rmarkdown::paged_table(final_world_bank_data)

Data Context

Before digging into the question at hand I wanted to explore some of the data so we can have a better understanding of what and who we’re looking at. To do this we’ll bring context to our groups by comparing GDP, import/export records, and two specific organizational affiliations.

Comparing GDP and GDP Per Capita

First let’s get an understanding of the size and general efficiency of the economies in question. To do this we’ll look at the spread of GDP and GDP per capita in the data while focusing on the status of GDP in 1990. Each observation is a single country from our data and we will separate them by their dependence status (Economic, Electric, or Both).

Show code
world_bank_1990 <- final_world_bank_data %>%
  filter(Year==1990)

world_bank_1990 %>% 
  ggplot() +
  geom_violin(scale="count",
              draw_quantiles = c(0.25, 0.5, 0.75),
              aes(x=FF_Status_1990, y=(GDP/1000000000), fill=FF_Status_1990)) +
  theme_bw() +
  theme(legend.position="none") +
  labs(x="Fossil Fuel Dependence Group",
       y="GDP in Billions, current USD",
       title= "1990 Gross Domestic Prouct",
       subtitle = "Grouped by Type of Fossil Fuel Dependence")

When focusing on the overall size of the economies we see that we have a strong concentration of economies with GDP of 100 billion USD or lower. A minimum of 75% of countries from each group are in that range. Only the economic dependence group (high fossil fuels rents) are above the 100 billion USD mark and only one country reaching above 200 (Russia).

Show code
world_bank_1990 %>% 
  ggplot() +
  geom_violin(scale="count",
              draw_quantiles = c(0.25, 0.5, 0.75),
              aes(x=FF_Status_1990, y=GDP_Per_Capita, fill=FF_Status_1990)) +
  theme_bw() +
  theme(legend.position="none") +
  labs(x="Fossil Fuel Dependence Group",
       y="GDP per capita, current USD",
       title= "1990 Gross Domestic Prouct Per Capita",
       subtitle = "Grouped by Type of Fossil Fuel Dependence")

Turning to GDP per capita, the story is a bit different. The greatest concentration in the lower range of GDP per capita is with the high rent countries, while the countries that show both types of dependence have the widest spread, the highest for each quartile, and by far the highest top range.

Overall, we may want to note here that we are mostly dealing with small economies, that those without economic dependence are the smallest, and that the type of dependence does not seem to have a direct effect on GDP per capita but a combination of both dependencies may.

Comparing Economic Activity

Next we’ll try to get a high level understanding of the economic activity that drives the countries in question. To do this we’ll compare their net imports for three sectors: energy, commercial services, and merchandise.

Energy Imports

We will start by comparing energy imports. The data is shown as the percentage of total energy consumption imported or exported, with negative numbers indicating the country is a net exporter of energy in proportion to their consumption.

Show code
world_bank_1990 %>% 
  group_by(FF_Status_1990) %>%
  summarise(Imports_Energy = sum(Imports_Energy)) %>%
  ggplot() +
  geom_col(aes(x=reorder(FF_Status_1990, Imports_Energy), y=Imports_Energy, fill=FF_Status_1990)) +
  theme_bw() +
  labs(fill= "Fossil Fuel Dependence Group",
       title="Net Energy Imports as a Proportion of Total Consumption",
       subtitle = "1990 Status by Fossil Fuel Dependence Group",
       x= "Dependence Group",
       y="Net Energy Imports") +
  theme(legend.position = "none")
Show code
world_bank_1990 %>% 
  ggplot() +
  geom_col(aes(x=reorder(Country, Imports_Energy), y=Imports_Energy, fill=FF_Status_1990)) +
  theme_bw() +
  labs(fill= "Fossil Fuel Dependence Group",
       title="Net Energy Imports as a Proportion of Total Consumption",
       subtitle = "1990 Status by Fossil Fuel Dependence Group",
       x= "Country",
       y="Net Energy Imports") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "bottom")

Maybe not surprisingly we see that countries that have high fossil fuel rents are almost entirely net exporters of energy, some exporting nearly 12x the amount of energy they use. While on the other end the countries that are only dependent for electricity production are net importers of energy.

Commercial Service Imports

Next we will look at net imports of commercial services. There are a number of countries without data available for 1990 so for those countries we will use the closest year with available data or exclude them entirely if there is no data available before the year 2000.

Show code
IC_years <- final_world_bank_data %>%
  group_by(Country, FF_Status_1990) %>%
  filter(!is.na(Imports_Commercial), Year < 2000) %>%
  filter(Year == min(Year))


IC_years %>% 
  group_by(FF_Status_1990) %>%
  summarise(Imports_Commercial = sum(Imports_Commercial)) %>%
  ggplot() +
  geom_col(aes(x=reorder(FF_Status_1990, Imports_Commercial), y=Imports_Commercial/1000000000, fill=FF_Status_1990)) +
  theme_bw() +
    labs(fill= "Fossil Fuel Dependence Group",
       title="Net Commercial Service Imports",
       subtitle = "1990 Status by Fossil Fuel Dependence Group",
       x= "Country",
       y="Commercial Imports, Billions USD") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "none")
Show code
IC_years %>% 
  ggplot() +
  geom_col(aes(x=reorder(Country, Imports_Commercial), y=Imports_Commercial/1000000000, fill=FF_Status_1990)) +
  theme_bw() +
  labs(fill= "Fossil Fuel Dependence Group",
       title="Net Commercial Service Imports",
       subtitle = "1990 Status by Fossil Fuel Dependence Group",
       y="Commercial Imports, Billions USD",
       x="Country") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "bottom")

The relationship here is not as clear for several reasons We see that the largest exporter is in our economic dependence group and the largest importer in the electricity dependence group, but the electricity dependent countries are more likely to be net exporters on average and economic dependents are more likely to be net importers. Not to mention that in sum, all groups are net imports of commercial services. What we can conclude is that commercial services are largely an expense or have little impact for all of these economies.

Merchandise Imports

Lastly, we will look at merchandise imports.

Show code
IM_years <- final_world_bank_data %>%
  group_by(Country) %>%
  filter(!is.na(Imports_Merchandise), Year < 2000) %>%
  filter(Year == min(Year))

IM_years %>% 
  group_by(FF_Status_1990) %>%
  summarise(Imports_Merchandise = sum(Imports_Merchandise)) %>%
  ggplot() +
  geom_col(aes(x=reorder(FF_Status_1990, Imports_Merchandise), y=Imports_Merchandise/1000000000, fill=FF_Status_1990)) +
  theme_bw() +
  labs(fill= "Fossil Fuel\nDependence Group",
       title="Net Merchandise Imports",
       subtitle = "1990 Status by Fossil Fuel Dependence Group",
       y="Merchandise Imports, Billions USD",
       x="Dependence Group") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "none")
Show code
IM_years %>% 
  ggplot() +
  geom_col(aes(x=reorder(Country, Imports_Merchandise), 
               y=Imports_Merchandise/1000000000, fill=FF_Status_1990)) +
  theme_bw() +
  labs(fill= "Fossil Fuel\nDependence Group",
       title="Net Merchandise Imports",
       subtitle = "1990 Status by Fossil Fuel Dependence Group",
       y="Merchandise Imports, Billions USD",
       x="Country") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "bottom")

Merchandise imports share some mirror image similarities to commercial services. The majority of net exporters are in our economic dependence group (including the group with both) while the majority of importers are from the electricity dependent group. The biggest exception is Egypt, which was both a net importer of merchandise and a net exporter of commercial services, differing from the majority of the economic dependence group.

We can more confidently conclude here that merchandise trade benefits our economic dependent countries, while the electricity dependent countries are spending to get the benefits of said merchandise.

Affiliations

In our final contextual comparison we will look at country affiliations with two international organizations to bring context to potential incentives and motivations. The first is the Organization of Petroleum Exporting Countries (OPEC), whose stated purpose is ” to coordinate and unify the petroleum policies of its Member Countries and ensure the stabilization of oil markets in order to secure an efficient, economic and regular supply of petroleum to consumers, a steady income to producers and a fair return on capital for those investing in the petroleum industry”. The second organization is the United Nations Economic and Social Council (US ESC) who, according to their website, is “at the heart of the United Nations system to advance the three dimensions of sustainable development – economic, social and environmental”.

Knowing who belongs to each of these organizations may help us better understand the actions of the countries we are examining. Below is a map and two comparisons that highlight these affiliations (all affiliations are as of May 2022).

Show code
# Create map of country affiliations
opec_map_countries <- c("Algeria", "Angola", "Democratic Republic of the Congo", 
                        "Equatorial Guinea", "Gabon", "Iran", "Kuwait", "Libya", "Nigeria",
                        "Saudi Arabia", "United Arab Emirates", "Venezuela")
unecosoc_map_countries <- c("Benin","Botswana","Democratic Republic of the Congo","Gabon",
                        "Israel","Kazakhstan","Libya","Nigeria","Oman","Russia",
                        "Tunisia")
other_map_countries <- c("Azerbaijan", "Bahrain", "Belarus", "Brunai Darussalam",
                         "Cyprus","Ecuador", "Egypt", "Gibraltar","Hong Kong",
                         "Indonesia","Iran","Israel","Jordan","Malaysia","Malta",
                         "Mongolia","Qatar","Syria","Trinidad and Tobago","Tunisia",
                         "Turkmenistan","Yemen")

AC <- tibble(c(opec_map_countries, unecosoc_map_countries)) %>% 
  rename(Country = `c(opec_map_countries, unecosoc_map_countries)`)

BothAC <- AC %>% group_by(Country) %>%
  summarise(Count = n()) %>%
  filter(Count == 2)

world_map <- map_data("world")
opec_map <- world_map %>% mutate(Affiliation =
                                   case_when(
                                     region %in% BothAC$Country ~ "Both",
                                     region %in% opec_map_countries ~ "OPEC",
                                     region %in% unecosoc_map_countries ~ "UN ESC",
                                     region %in% other_map_countries ~ "Neither"))

ggplot(opec_map, aes(x = long, y = lat, group = group)) +
  geom_polygon(aes(fill=Affiliation), colour = "white") +
  theme(axis.title = element_blank(),
        legend.position = "bottom") +
    labs(title="Affiliation with OPEC and UN Economic and Social Council",
       subtitle = "Fossil Fuel Dependent Countries",
       caption = "All affiliations as of May 2022'")

We may take note of the wide scope of locations in our data. Most coming from Africa and the Middle East, but the data also includes countries in Europe, South America, and Asia.

Show code
world_bank_1990 %>% 
  mutate(Affiliation =
           case_when(
             UN_Eco_Soc == "Yes" & OPEC == "Yes" ~ "Both",
             UN_Eco_Soc == "No" & OPEC == "No" ~ "Neither",
             UN_Eco_Soc == "Yes" ~ "UNESC",
             OPEC == "Yes" ~ "OPEC"
           )) %>%
  ggplot() +
  geom_bar(aes(x=Affiliation, 
               fill=FF_Status_1990)) +
  theme_bw() +
  labs(fill= "Fossil Fuel Dependence Group") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "bottom") +
  labs(title="Total Number of Affiliations with OPEC and UN ESC",
       subtitle = "Fossil Fuel Dependent Countries",
       caption = "All affiliations as of May 2022'",
       x="Affiliation",
       y="Number of Countries")
Show code
world_bank_1990 %>% 
  mutate(Affiliation =
           case_when(
             UN_Eco_Soc == "Yes" & OPEC == "Yes" ~ "Both",
             UN_Eco_Soc == "No" & OPEC == "No" ~ "Neither",
             UN_Eco_Soc == "Yes" ~ "UNESC",
             OPEC == "Yes" ~ "OPEC"
           )) %>%
  ggplot() +
  geom_bar(aes(x=Affiliation, 
               fill=FF_Status_1990),
           position="fill") +
  theme_bw() +
  labs(fill= "Fossil Fuel Dependence Group") +
  theme(axis.text.x = element_text(angle=55, hjust=1),
        legend.position = "bottom") +
    labs(title="Portion of Affiliations with OPEC and UN ESC",
       subtitle = "Fossil Fuel Dependent Countries",
       caption = "All affiliations as of May 2022'",
       x="Affiliation",
       y="Portion of Dependence Group")

We may also note that about half of the countries are part of one of these organizations. The UN Economic and Social Council has the largest affiliation with OPEC not fair behind. The UN ESC is fairly split between those in our economic and electricity dependence groups. Not surprisingly we also see that only economically dependent countries are part of OPEC.

Contextual Conclusions

Wrapping up this section I think we can bring a few conclusions with us through the remainder of this analysis.

  1. About half of the economic dependent group is affiliated with OPEC.
  2. About a quarter of the electric dependent group is part of the UN ESC.
  3. Countries that rely on fossil fuels for economic activity are large exporters, whether or not they rely on fossil fuels for electricity production.
  4. All three groups are net importers of commercial services in the 1990s, but on average the electricity group are exporters with the exception of Hong Kong.
  5. Merchandise imports are essentially the opposite. Economically dependent countries are net exporters and electricity dependent are net importers. Good to note that the economic status of the country determines the import status (i.e. countries in the Both group are exporters).
  6. The data are wide spread around the globe, but with a concentration in Africa and the Middle East.

Identifying Change

Producing Electricity

Now that we have the data required and some context for what is in the data we can start to explore the trends that we are most interested in. To start, we’ll look at what portion of electricity is being produced by fossil fuels and how that has changed in the last thirty years.

Show code
final_world_bank_data %>% 
  group_by(FF_Status_1990, Year) %>%
  summarise(ELE_Prod_Fossil_Fuels = mean(ELE_Prod_Fossil_Fuels, na.rm=TRUE)) %>%
  ggplot() +
  geom_line(aes(x=Year, y=ELE_Prod_Fossil_Fuels, color=FF_Status_1990)) +
  geom_smooth(aes(x=Year, y=ELE_Prod_Fossil_Fuels, color=FF_Status_1990)) +
  theme_bw() +
  labs(color= "1990 Dependence\nStatus",
       y="Energy Production from Fossil Fuels (%)",
       title="Portion of Total Energy Produced with Fossil Fuels")

Three themes emerge looking at the trend. First, our economic dependent group has steadily increased their reliance on fossil fuels for electricity production. Second, our electricity dependent group has steadily decrease their dependence on fossil fuels for electricity, but only in the last decade. And third, countries that were economically dependent and already producing almost all their electricity with fossil fuels have made no effort to reduce that dependence.

Now let’s take a look at the overall change in production methods at the country level. We do this by looking at the difference between the 1990 level and the most recent year the data is available for each country.

Show code
# I couldn't think of a more elegant way to do this, so here it goes...
ele_change <- final_world_bank_data %>%
  group_by(Country) %>%
  filter(!is.na(ELE_Prod_Fossil_Fuels)) %>%
  filter(Year == min(Year) | Year == max(Year)) %>%
  summarise(FF_Status_1990 = FF_Status_1990,
            ELE_Prod_Change = ELE_Prod_Fossil_Fuels - lag(ELE_Prod_Fossil_Fuels)) %>%
  filter(!is.na(ELE_Prod_Change)) %>%
  ggplot(aes(x=ELE_Prod_Change)) +
  geom_histogram(aes(fill=FF_Status_1990), color="black") +
  theme_bw() +
  labs(color= "1990 Dependence\nStatus",
       y="Number of Countries",
       x="Change in Portion of Total Energy Produced",
       title="Change in the Portion of Total Energy Produced with Fossil Fuels")

ele_change

Here we can see that nearly half of the countries have not changed the way they produce electricity at all (16/37 countries). We do see more clearly the trend we noticed before: Most electricity dependent countries have started to decrease dependence, countries with both dependencies have not changed at all, and most economic dependent countries have increased their dependence on fossil fuels for electricity and several by more than 20 percentage points. Focusing on the economically dependent group we will note that two countries reduced their dependence and that there was one outlier that increased dependence by 45 percentage points.

Economic Dependence (Fossil Fuel Rents)

Now let’s do the same for economic dependence as measured by Fossil Fuel Rents.

Show code
final_world_bank_data %>%
  group_by(FF_Status_1990, Year) %>%
  summarise(NAT_Fossil_Fuel_Rents = mean(NAT_Fossil_Fuel_Rents, na.rm=TRUE)) %>%
  ggplot() +
  geom_line(aes(x=Year, y=NAT_Fossil_Fuel_Rents, color=FF_Status_1990)) +
  geom_smooth(aes(x=Year, y=NAT_Fossil_Fuel_Rents, color=FF_Status_1990)) +  
  theme_bw() +
  labs(color= "1990 Dependence\nStatus",
       y="Annual Fossil Fuel Rent",
       title="Annual Fossil Fuel Rents by Dependence Group")

The trend shows some indication that our countries with economic dependence have been reducing that dependence, but due to the variation year to year we have less confidence that any real change has occurred (note the standard error). The electricity dependent group stayed fairly steady until the late 2000’s when we see an increase in fossil fuel rents. This change does come back down, but is largely sustained throughout the remainder of the time.

Now let’s look at the overall differences between 1990 and the most recent year the data is available at the country level.

Show code
# Still couldn't find a better way so here we go again...

rent_change <- final_world_bank_data %>%
  group_by(Country) %>%
  filter(!is.na(NAT_Fossil_Fuel_Rents)) %>%
  filter(Year == min(Year) | Year == max(Year)) %>%
  summarise(FF_Status_1990 = FF_Status_1990,
            Rent_Change = NAT_Fossil_Fuel_Rents - lag(NAT_Fossil_Fuel_Rents)) %>%
  filter(!is.na(Rent_Change)) %>%
  ggplot(aes(x=Rent_Change)) +
  geom_histogram(aes(fill=FF_Status_1990), 
                 color="black")  +
  theme_bw() +
  labs(fill="1990 Dependence\nStatus",
       y="Number of Countries",
       x="Change in Fossil Fuel Rent",
       title="Change in Fossil Fuel Rents")
rent_change

This view gives us a couple of new insights. We see that most of the economically dependent countries, including those with both dependencies, decreased their dependence with only four increasing. There is again an outlier in this group that reduced their fossil fuel rent by greater than 50 percentage points.

Unsurprisingly, the electricity dependent group had only minor changes and we see that the increase we saw in the trend is associated with just one country increasing.

Other Economic Factors

The next factor we’ll look into is if and how countries are preparing to support their economies through non-fossil fuel production activities.

First, let’s look at commercial service imports.

Show code
econ_data <- final_world_bank_data %>%
  group_by(FF_Status_1990, Year) %>%
  summarise(Mean_Imports_Commercial = mean(Imports_Commercial, na.rm=TRUE)/1000000000,
            Mean_Imports_Merchandise = mean(Imports_Merchandise, na.rm=TRUE)/1000000000,
            Imports_CandM = (Mean_Imports_Merchandise + Mean_Imports_Commercial)/1000000000,
            GDP = mean(GDP, na.rm=TRUE)/1000000000,
            GDP_Per_Capita = mean(GDP_Per_Capita, na.rm=TRUE))
#comm_trend <- 
ggplot(econ_data) +
  geom_line(aes(x=Year, y=Mean_Imports_Commercial, color=FF_Status_1990)) +
  geom_smooth(aes(x=Year, y=Mean_Imports_Commercial, color=FF_Status_1990)) +  
  theme_bw() +
  labs(color= "1990 Dependence\nStatus",
       title="Annual Net Commercial Service Imports by Dependence Group",
       y="Commercial Imports, Billions USD")

The trend here is very clear. Commercial service trade was steady through the 1990’s and in the early 2000’s we see economically dependent countries increase imports and electricity dependent countries increase exports.

Second, let’s look at Merchandise Imports.

Show code
#merc_trend <- 
ggplot(econ_data) +
  geom_line(aes(x=Year, y=Mean_Imports_Merchandise, color=FF_Status_1990)) +
  geom_smooth(aes(x=Year, y=Mean_Imports_Merchandise, color=FF_Status_1990)) +  
  theme_bw() +
  labs(color= "1990 Dependence\nStatus",
       title="Annual Net Merchandise Imports by Dependence Group",
       y="Merchandise Imports, Billions USD")

There are two trends that appear. First, countries that have economic dependence on fossil fuels have increased their exports of merchandise. We do see this trend reversing in the 2010’s and we conclude this with a low confidence (reference the standard error again). Second, electricity dependent countries have increased their imports of merchandise. This is a continuation of what we saw in the 1990’s data, but increasingly so.

We are also continue to see the dominance of the economic dependence. In every aspect we have examined the group with both dependencies has followed the trend of the economic-only group, even though they share dependence with both groups.

One last look at economic activity combining the two sectors we looked at separately.

Show code
#merc_trend <- 
ggplot(econ_data) +
  geom_line(aes(x=Year, y=Imports_CandM, color=FF_Status_1990)) +
  geom_smooth(aes(x=Year, y=Imports_CandM, color=FF_Status_1990)) +  
  theme_bw() +
  labs(color= "1990 Dependence\nStatus",
       title="Annual Net Imports by Dependence Group",
       subtitle="Commercial Service and Merchandise Imports",
       y="Net Imports, Billions USD")

When we combine economic activities we notice that, in sum, our economically dependent groups have increased net exports while non-economically dependent group has increase net imports.

Reflection

I found this project both engaging and frustrating, which was a good balance for learning.

  1. Choosing the data - As I used a custom data set that I pulled from the World Bank at my discretion I had the benefit of taking exactly what I needed and exploring a wide range of data that was available. The downside was that several times I pulled interesting data that ended up being extremely limited (low number of observations) or pulled data that was missing key components so I had to create, import, clean, tidy, explore…rinse and repeat several times before I had a data set that I was happy with and that I thought could serve to answer some interesting questions confidently.

  2. Cleaning, tidying, and exploring - I enjoyed this portion of the project because I learned a lot of new techniques, but it was also some of the most frustrating parts. I learned how to pivot effectively, how to use the mutate function to create new variables, how to apply changes to wide portions of the data set efficiently using the across function, and how to explore the validity of the data set. Also because I did this several times I created a good work flow for myself to uncover common issues with the data quickly, which I believe will be useful in the future. This is where I had to make a lot of the crucial decisions as well. From choosing the right time frame, the criteria for countries to include, and the right variables to use this was a good exercise in understanding the importance of such decisions and needing to be confident in and be able to explain why I made those decisions.

  3. Visualizing - This was some of the most fun. I was familiar with ggplot prior to this project, but got to explore a lot more of the functionality, including new types of plots and how to utilize themes. I learned a lot about how to effectively use the captions, axes, and legends to make them clear. Someone once said to me that I should be able to skim through and article and have the visualizations stand on their own, so I hope I was able to do this here. What I wish I knew more and learned more is about utilizing colors. I need to explore themes a lot more.

  4. Coming to conclusions - The data were clear in some spaces and rose more questions in other spaces. I had to come to confident conclusions where I could, but also realize the limitations of the analysis and the data. With more time I could have come to better conclusions. Additionally, many of my conclusions are not based strictly in statistics so my confidence in them is lower than I would like. One of the big gaps for me is knowing what the right statistical technique to use is for each situation.

  5. R Markdown - My experience with R Markdown is fairly limited and using it in this depth was quite beneficial. I appreciate the ability to easily annotate the process and run the code in chucks repeated with small changes. I learned a lot about how to format in R Markdown, but feel there is a large amount still left to learn to make the output more professional and customized to better fit the story I am trying to convey.

Conclusions and Next Steps

To wrap things up we will revisit our initial question in three parts.

Are dependent countries transitioning from fossil fuels as the source of energy production?

Using electricity production as our indicator of total energy production we noticed that it differs substantially by group.

For countries that do not have an economic dependence on fossil fuels (Electric group) we see a transition to non-fossil fuel electricity production that has continued over the last decade. None of these countries increased with dependence on fossil fuels for electricity and a majority (7/11) have decreased. A good trend indicating a transition away from fossil fuel dependence.

For countries that have an economic dependence on fossil fuel production (Economic and Both groups) we see an increase in energy production from fossil fuels. On an individual level about seventy percent of these countries increased production by fossil fuels while only around ten percent have decreased. This trend indicates a reluctance or inability for these countries to transition.

Are other economic activities increasing to replace reliance on fossil fuel production?

For countries that have an economic dependence on fossil fuels we see two relevant trends. Their reliance on fossil fuels specifically has reduced in a majority of countries as shown by the decrease in fossil fuel rents, but the confidence in this being a real change is fairly low. On the other hand, we do see an increase in net exports for these countries which could be used to replace fossil fuel production. This change may serve to increase our confidence in fossil fuel reliance decreasing as well. On the whole, I will consider this inconclusive but with a tendency toward a good trend for transitioning from fossil fuel reliance.

For non-economic dependence countries we see an increase in fossil fuel rents, but only due to one country. The group as a whole had no change (no change that could be made) or a small reduction in two instances. For other economic activities we see a steady trend overall and a focus on the exporting of commercial services. Due to their non-reliance on fossil fuels for economic health I will consider this a good trend as there was no concerted effort to increase economic reliance on fossil fuels.

So…Are fossil fuel dependent countries preparing for a post-fossil fuel world?

From the analysis conducted on available data, the indication is yes, highly dependent countries are addressing their dependencies. Electricity dependent countries are increasing energy production from sources other than fossil fuels and economically dependent countries are diversifying and creating economic activity from sources other than fossil fuel production.

On the other hand, countries with economic dependence are increasing their use of fossil fuels for electricity production, our confidence in some of the changes is low, and the speed at which these transitions are occurring is an open question due to the strict timeline.

We have generated more questions than answers from this brief analysis and it is deserving of more attention and granularity. Below I will address some of the limitations.

Limitations

This analysis has a number of limitations surrounding the certainty of the assumptions, the limitations of the data set, and the limitations of a strictly quantitative approach to understanding the question. I will discuss here only some of the most pertinent limitations.

  1. We are trying to predict the sustainability of societies through quantitative methods. This gives us a starting point to understand some of the activities that are happening, but does not address or give any insight to the question of WHY this transition is or is not happening.
  2. We are looking at a small snapshot of time. Economic trends happen in both large and small cycles. For the components we’re analyzing we do not know the other-cycle trends so we could be missing key information.
  3. We did not do any prescriptive analysis. Knowing what we know, we did not answer the question of timeliness. We know the general trends, but we do not know if those trends are appropriate for the timelines that we understand as necessary for this transition to take place.
  4. We focused on two extreme of dependence. The implications of this situations are far ranging so our analysis is applicable only for a small sub-set of the affected population.
  5. There is missing data which we did not predict or impute or assess if these methods would be appropriate. Maybe most importantly, some of the missing data is due to it being inaccessible for societal reasons. Our question being about the sustainability of societies it may be an indication that the most important data is missing.

Bibliography

Canes, M. E. (2015, August). Fossil Fuel Energy and Economic Wellbeing. George C. Marshal Institute. https://marcelluscoalition.org/wp-content/uploads/2015/08/Fossil-Fuel-Energy-Economic-Wellbeing.pdf

“Consumption by Fuel,” BP Statistical Review of World Energy 2015, p. 41.

Lewis, J. (1990, January). The Spirit of the First Earth Day. Archive.Org. Retrieved April, 2022, from https://web.archive.org/web/20100328214819/http:/www.epa.gov/history/topics/earthday/01.htm

Our Mission. (n.d.). Organization of the Petroleum Exporting Countries. Retrieved May, 2022, from https://www.opec.org/opec_web/en/about_us/23.htm

R Core Team (2021). R: A language and environment for statistical computing. R version 4.1.2. https://www.R-project.org/.

United Nations Economic and Social Council. (n.d.). United Nations. Retrieved May, 2022, from https://www.un.org/ecosoc/en/content/about-us

Wickham, H., & Grolemund, G. (2016). R for data science: Visualize, model, transform, tidy, and import data. OReilly Media. Retrieved from https://r4ds.had.co.nz/index.html

World Development Indicators, The World Bank, https://databank.worldbank.org/source/world-development-indicators, Retrieved April, 2022.

Worldometer Energy. (n.d.). Worldometer. Retrieved April 2022, from https://www.worldometers.info/

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Bartelloni (2022, May 19). Data Analytics and Computational Social Science: TB DACSS 601 Final Project. Retrieved from https://github.com/DACSS/dacss_course_website/posts/httpsrpubscomtbartelloni902386/

BibTeX citation

@misc{bartelloni2022tb,
  author = {Bartelloni, Tory},
  title = {Data Analytics and Computational Social Science: TB DACSS 601 Final Project},
  url = {https://github.com/DACSS/dacss_course_website/posts/httpsrpubscomtbartelloni902386/},
  year = {2022}
}