folder_path <- partial(here, "00_data", "sov_debt_paris_alignment")
folder_path() %>% list.files()
##  [1] "country_list_bis_debt_securities.csv"  
##  [2] "country_list_combined_bond_indices.csv"
##  [3] "country_list_em_dm.csv"                
##  [4] "emissions_dataset_full.csv"            
##  [5] "emissions_dataset_full.rds"            
##  [6] "emissions_dataset.csv"                 
##  [7] "emissions_dataset.rds"                 
##  [8] "imf_wb_country_groups.csv"             
##  [9] "imf_wb_country_groups.rds"             
## [10] "wb_income_groups.csv"                  
## [11] "wb_income_groups.rds"                  
## [12] "weo_world_income_population.csv"       
## [13] "weo_world_income_population.rds"
emissions_dataset_full <- folder_path("emissions_dataset_full.rds") %>%
  read_rds()

imf_wb_country_groups <- folder_path("imf_wb_country_groups.rds") %>%
  read_rds()

Intro

Carbon emissions trading allows countries to buy and sell allotments of carbon dioxide output. The goal of carbon emissions trading is to limit carbon dioxide emissions and slow down global warming. This analysis target the carbon emission data in East Asia & Pacific Region, using data from IMF and World Bank Group.

View Data

emissions_dataset_full %>% glimpse()
## Rows: 6,702
## Columns: 31
## $ iso3c                                <chr> "AFG", "AFG", "AFG", "AFG", "AFG"…
## $ year                                 <dbl> 1990, 1991, 1992, 1993, 1994, 199…
## $ gdp_usd_current_prices               <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ gdp_ppp_current_prices               <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ gdp_pc_usd_current_prices            <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ gdp_pc_ppp_current_prices            <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ population                           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ govt_expenditure_pct_gdp             <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ debt_pct_gdp                         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ territorial_co2                      <dbl> 2.603, 2.427, 1.379, 1.333, 1.282…
## $ trade_co2                            <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ consumption_co2                      <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ cumulative_co2                       <dbl> 59.182, 61.610, 62.989, 64.322, 6…
## $ debt_usd                             <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ govt_expenditure_usd                 <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ territorial_co2_per_capita           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ trade_co2_per_capita                 <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ consumption_co2_per_capita           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ territorial_co2_per_gdp              <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ trade_co2_per_gdp                    <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ consumption_co2_per_gdp              <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ territorial_co2_per_debt             <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ trade_co2_per_debt                   <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ consumption_co2_per_debt             <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ debt_usd_per_capita                  <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ territorial_co2_per_govt_expenditure <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ trade_co2_per_govt_expenditure       <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ consumption_co2_govt_expenditure     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ govt_expenditure_per_capita          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ trade_pct_of_consumption_co2         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ cumulative_co2_per_capita            <dbl> NA, NA, NA, NA, NA, NA, NA, NA, N…
#glimpse(emissions_dataset_full)#
imf_wb_country_groups %>% glimpse()
## Rows: 2,587
## Columns: 3
## $ country_name  <chr> "Australia", "Austria", "Belgium", "Canada", "Switzerlan…
## $ country_group <chr> "Advanced Economies", "Advanced Economies", "Advanced Ec…
## $ group_type    <chr> "IMF", "IMF", "IMF", "IMF", "IMF", "IMF", "IMF", "IMF", …

Clean Data

Use Data from 2019 (pivot_longer version vs normal version)

emissions_dataset_full_2019_pivoted <- emissions_dataset_full %>%
  filter(year == 2019) %>%   
  select(-year) %>%
  pivot_longer(cols = gdp_usd_current_prices:cumulative_co2_per_capita, names_to = "aggregates")

emissions_dataset_full_2019_pivoted
emissions_dataset_full_2019 <- emissions_dataset_full %>%
  filter(year == 2019)

emissions_dataset_full_2019

Use Data about East Asia & Pacific Countries

imf_wb_country_groups_eastasiap <- imf_wb_country_groups %>%
  filter(country_group == "East Asia & Pacific")
  
imf_wb_country_groups_eastasiap

Standardizing Country Names

country_name_regex_to_iso3c <- function(country_name) {
  country_name %>%
    countrycode(origin = "country.name", 
                                     destination = "iso3c",
                                     origin_regex = TRUE)
}

iso3c_to_country_name <- function(iso3c) {
  iso3c %>%
  countrycode(origin = "iso3c", destination = "country.name")
}

imf_wb_country_groups_eastasiap_iso3c <- imf_wb_country_groups_eastasiap %>%
  mutate(iso3c = country_name_regex_to_iso3c(country_name)) 

imf_wb_country_groups_eastasiap_iso3c

Joining Two Datasets

emissions_dataset_full_2019_eastasiap <- imf_wb_country_groups_eastasiap_iso3c %>% left_join(emissions_dataset_full_2019, by = "iso3c")

emissions_dataset_full_2019_eastasiap 

Summary Statistics

Macroeconomics

#gdp of the East Asia & Pacific countries
sum(emissions_dataset_full_2019_eastasiap$gdp_usd_current_prices, na.rm=TRUE)
## [1] 27049.28
#gdp per capita of the East Asia & Pacific countries
sum(emissions_dataset_full_2019_eastasiap$gdp_ppp_current_prices, na.rm=TRUE)
## [1] 43296.22
#Government Expenditure / GDP of the East Asia & Pacific countries (Top)
min(emissions_dataset_full_2019_eastasiap$govt_expenditure_pct_gdp, na.rm=TRUE)
## [1] 14.107
max(emissions_dataset_full_2019_eastasiap$govt_expenditure_pct_gdp, na.rm=TRUE)
## [1] 124.185
#Debt / gdp of the East Asia & Pacific countries (Top)
min(emissions_dataset_full_2019_eastasiap$debt_pct_gdp, na.rm=TRUE)
## [1] 0
max(emissions_dataset_full_2019_eastasiap$debt_pct_gdp, na.rm=TRUE)
## [1] 235.448

CO2 Emission Summary Statistics

#territorial CO2 of the East Asia & Pacific countries: total emission per capita
sum(emissions_dataset_full_2019_eastasiap$territorial_co2_per_capita, na.rm=TRUE)
## [1] 179.455
#territorial CO2 of the East Asia & Pacific countries: average emission per capita
mean(emissions_dataset_full_2019_eastasiap$territorial_co2_per_capita, na.rm=TRUE)
## [1] 5.981833
#cumulative_co2
sum(emissions_dataset_full_2019_eastasiap$cumulative_co2, na.rm=TRUE)
## [1] 380864.2
mean(emissions_dataset_full_2019_eastasiap$cumulative_co2, na.rm=TRUE)
## [1] 11541.34
min(emissions_dataset_full_2019_eastasiap$cumulative_co2, na.rm=TRUE)
## [1] 0.271
max(emissions_dataset_full_2019_eastasiap$cumulative_co2, na.rm=TRUE)
## [1] 224896.1
#CO2 / government expenditure 
sum(emissions_dataset_full_2019_eastasiap$territorial_co2_per_govt_expenditure, na.rm=TRUE)
## [1] 0.6956039
mean(emissions_dataset_full_2019_eastasiap$territorial_co2_per_govt_expenditure, na.rm=TRUE)
## [1] 0.0231868
min(emissions_dataset_full_2019_eastasiap$territorial_co2_per_govt_expenditure, na.rm=TRUE)
## [1] 0.001313696
max(emissions_dataset_full_2019_eastasiap$territorial_co2_per_govt_expenditure, na.rm=TRUE)
## [1] 0.2019322

Territorial CO2 Emission Summary Statistics

#territorial CO2 of the East Asia & Pacific countries: the biggest emitter and smallest emitter
min(emissions_dataset_full_2019_eastasiap$territorial_co2, na.rm=TRUE)
## [1] 0.008
max(emissions_dataset_full_2019_eastasiap$territorial_co2, na.rm=TRUE)
## [1] 10489.99

Graph Top 8 Territorial CO2 Emitter Among East Asia & Pacific Countries in 2019

emissions_dataset_full_2019_eastasiap %>%
  slice_max(order_by = territorial_co2, n = 8) %>%
  ggplot(aes(x = fct_reorder(.f = country_name,.x = territorial_co2, 
                             .desc = TRUE), 
             y = territorial_co2)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = format(territorial_co2, digits = 4, big.mark = ",")), vjust = -0.2) + 
  scale_y_continuous(limits = c(0, 10500), breaks = scales::pretty_breaks(n = 15)) +  theme_minimal() +
  labs(title = "Territorial CO2 Emission Among East Asia & Pacific Countries in 2019",
       subtitle = "Top 8 Countries",
       x = "country",
       y = "territorial co2 level",
       caption = "Data from World Bank Group and IMF") +
  theme(legend.position = "bottom") 

Territorial CO2 Emission per Capita Summary Statistics

#territorial CO2 of the East Asia & Pacific countries: the biggest emiitter and smallest emitter per capita
min(emissions_dataset_full_2019_eastasiap$territorial_co2_per_capita, na.rm=TRUE)
## [1] 0.4060325
max(emissions_dataset_full_2019_eastasiap$territorial_co2_per_capita, na.rm=TRUE)
## [1] 26.90052

Graph Top 8 Territorial CO2 Emitter per Capita Among East Asia & Pacific Countries in 2019

emissions_dataset_full_2019_eastasiap %>%
  slice_max(order_by = territorial_co2_per_capita, n = 8) %>%
  ggplot(aes(x = fct_reorder(.f = country_name,.x = territorial_co2_per_capita, 
                             .desc = TRUE), 
             y = territorial_co2_per_capita)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = format(territorial_co2_per_capita, digits = 2, big.mark = ",")), vjust = -0.2) + 
  scale_y_continuous(limits = c(0, 27), breaks = scales::pretty_breaks(n = 15)) +  theme_minimal() +
  labs(title = "Territorial CO2 Emission per Capita Among East Asia & Pacific Countries in 2019",
       subtitle = "Top 8 Countries",
       x = "country",
       y = "territorial co2 per capita level",
       caption = "Data from World Bank Group and IMF") +
  theme(legend.position = "bottom") 

Analysis

This poses the question, should one be more concerned with the total emission level or the per capita emission level data. Which countries should the World Bank Group and IMF pay more attention to curbing carbon emission [China, Japan and Indonesia] or [Mongolia, Brunei and Australia]? The World Bank Group and IMF could design different methodologies.

Trading CO2

Largest Importer of CO2

Annual CO2 Emission Level Embeded in Trade Summary Statistics

#trade_co2
##Annual net carbon dioxide (CO2) emissions embedded in trade, measured in million tonnes. Net CO2 emissions embedded in trade is the net of CO2 which is imported or exported via traded goods with an economy. A positive value denotes a country or region is a net importer of CO2 emissions; a negative value indicates a country is a net exporter.
sum(emissions_dataset_full_2019_eastasiap$trade_co2, na.rm=TRUE)
## [1] -735.465
mean(emissions_dataset_full_2019_eastasiap$trade_co2, na.rm=TRUE)
## [1] -43.26265
min(emissions_dataset_full_2019_eastasiap$trade_co2, na.rm=TRUE)
## [1] -1047.154
max(emissions_dataset_full_2019_eastasiap$trade_co2, na.rm=TRUE)
## [1] 182.134

####Graph Top 7 Annual CO2 Emission Level Embeded in Trade Among East Asia & Pacific Countries in 2019

emissions_dataset_full_2019_eastasiap %>%
  slice_max(order_by = trade_co2, n = 7) %>%
  ggplot(aes(x = fct_reorder(.f = country_name,.x = trade_co2, 
                             .desc = TRUE), 
             y = trade_co2)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = format(trade_co2, digits = 3, big.mark = ",")), vjust = -0.2) + 
  scale_y_continuous(limits = c(0, 200), breaks = scales::pretty_breaks(n = 15)) +  theme_minimal() +
  labs(title = "Top 7 Annual CO2 Emission Level Embeded in Trade Among East Asia & Pacific Countries in 2019",
       subtitle = "7 Largest Importers",
       x = "country",
       y = "trade_co2",
       caption = "Data from World Bank Group and IMF") +
  theme(legend.position = "bottom") 

Annual CO2 Emission Level Embeded in Trade per capita Summary Statistics

#trade_co2
##Annual net carbon dioxide (CO2) emissions 
sum(emissions_dataset_full_2019_eastasiap$trade_co2_per_gdp, na.rm=TRUE)
## [1] -0.1427397
mean(emissions_dataset_full_2019_eastasiap$trade_co2_per_gdp, na.rm=TRUE)
## [1] -0.008396451
min(emissions_dataset_full_2019_eastasiap$trade_co2_per_gdp, na.rm=TRUE)
## [1] -0.3700966
max(emissions_dataset_full_2019_eastasiap$trade_co2_per_gdp, na.rm=TRUE)
## [1] 0.1425045

Graph Top 7 Annual CO2 Emission Level Embeded in Trade per capita Among East Asia & Pacific Countries in 2019

emissions_dataset_full_2019_eastasiap %>%
  slice_max(order_by = trade_co2_per_gdp, n = 7) %>%
  ggplot(aes(x = fct_reorder(.f = country_name,.x = trade_co2_per_gdp, 
                             .desc = TRUE), 
             y = trade_co2_per_gdp)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = format(trade_co2_per_gdp, digits = 1, big.mark = ",")), vjust = -0.2) + 
  scale_y_continuous(limits = c(0, 0.15), breaks = scales::pretty_breaks(n = 15)) +  theme_minimal() +
  labs(title = "Annual CO2 Emission Level Embeded in Trade per capita Among East Asia & Pacific Countries in 2019",
       subtitle = "7 Largest Importers",
       x = "country",
       y = "trade_co2_per_gdp",
       caption = "Data from World Bank Group and IMF") +
  theme(legend.position = "bottom") 

Analysis

Based on the stats and graphs, Hong Kong SAR China, Singapore, Japan are largest importer of carbon emission.

Largest Exporter of Carbon

Graph Lowest 7 Annual CO2 Emission Level Embeded in Trade Among East Asia & Pacific Countries in 2019

emissions_dataset_full_2019_eastasiap %>%
  slice_min(order_by = trade_co2, n = 7) %>%
  ggplot(aes(x = fct_reorder(.f = country_name,.x = trade_co2, 
                             .desc = TRUE), 
             y = trade_co2)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = format(trade_co2, digits = 3, big.mark = ",")), vjust = -0.2) + 
  scale_y_continuous(limits = c(-1050, 1), breaks = scales::pretty_breaks(n = 15)) +  theme_minimal() +
  labs(title = "Lowest 7 Annual CO2 Emission Level Embeded in Trade Among East Asia & Pacific Countries in 2019",
       subtitle = "7 Largest Exporters",
       x = "country",
       y = "trade_co2",
       caption = "Data from World Bank Group and IMF") +
  theme(legend.position = "bottom") 

Graph Lowest 7 Annual CO2 Emission Level per Capita Embeded in Trade Among East Asia & Pacific Countries in 2019

emissions_dataset_full_2019_eastasiap %>%
  slice_min(order_by = trade_co2_per_capita, n = 7) %>%
  ggplot(aes(x = fct_reorder(.f = country_name,.x = trade_co2_per_capita, 
                             .desc = TRUE), 
             y = trade_co2_per_capita)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = format(trade_co2_per_capita, digits = 3, big.mark = ",")), vjust = -0.2) + 
  scale_y_continuous(limits = c(-5, 0), breaks = scales::pretty_breaks(n = 15)) +  theme_minimal() +
  labs(title = "Annual CO2 Emission Level per Capita Embeded in Trade Among East Asia & Pacific Countries in 2019",
       subtitle = "7 Largest Exporters",
       x = "country",
       y = "trade_co2_per_capita",
       caption = "Data from World Bank Group and IMF") +
  theme(legend.position = "bottom") 

#### Analysis China, Mongolia, and Vietnam are large exporter of the carbon in 2019 among the east asia & pacific countries.

Conclusion

This data analysis demonstrated the largest carbon emitters, largest carbon exporters, and largest carbon importers among the East Asia & Pacific nations in 2019. Further research on finding correlations between those variables could be valuable. Ex. Mongolia as one of largest carbon emitter is also one of the largest carbon exporters. Why? How could policies help to regulate carbon emission?

Further Readings

Carbon taxes and emissions trading are cheapest ways of reducing CO2, OECD says https://www.oecd.org/newsroom/carbon-taxes-and-emissions-trading-are-cheapest-ways-of-reducing-co2.htm

Mongolia: CO2 Country Profile - Our World in Data https://unfccc.int/resource/docs/natc/mongnc1.pdf

Mongolia: CO2 Country Profile https://ourworldindata.org/co2/country/mongolia

Trade and Climate Change https://www.wto.org/english/news_e/news21_e/clim_03nov21-4_e.pdf

Co2 Emissions Embodied in International Trade and Domestic Final Demand https://www.oecd.org/sti/ind/TECO2_OECD_webdoc2020.pdf

Sources of Greenhouse Gas Emissions https://www.epa.gov/ghgemissions/sources-greenhouse-gas-emissions