Data_Analysis_6
PCAF Emissions - Key Metrics
There are four main calculations in PCAF’s Sovereign Debt Metrics for Financed Emissions:
Consumption Emissions
= Scope 1 + 2 + 3 Emissions - Exported Emissions
Attributed Emissions
= [Exposure to Sovereign Bond (USD) / PPP-adjusted GDP (International USD)] * Sovereign Emissions (tCO2e)
Financed Emissions
= Sigma (S) Attributed factor (s) * Sovereign Emissions (s) … (s = sovereign borrower)
Attribution Factor
= Sigma (S) Outstanding amount (s) / PPP-adjusted GDP (s) * sovereign emissions (s) … (s = sovereign borrower)
The main data points gathered for analysis are:
Sovereign Emissions (both CO2 and total GHG emissions as tCO2e)
GDP-PPP
Exposure to Sovereign Bonds
Loading Libraries for Analysis & Country Code Fx
Packages below are to help “tidy” the data within the tidyverse packages as well as incorporate geospatial data identifiers like iso3c country codes for joining different data tables. Additionally a country code function has been added to facilitate faster transformations of country level data.
Gathering Sovereign Emissions
A key metric in calculating attributed emissions, financed emissions, and attribution factor in PCAF’s Sovereign Debt metrics are Sovereign Emissions. To calculate these, data was gathered from PCAF’s suggested Scope 1 data sources like Climate Watch for CO2 emissions by country. It was joined with additional data from the EU’s EDGAR database and OECD’s Emissions in International Trade database to compare CO2 and total GHG emissions (CO2 equivalent) using ____ as a unique identifier. Additional emissions are listed on the UNFCCC’s page for select countries but have not been included at this time.
Loading in Climate Watch CO2 Emissions
Loading in the CO2 Emissions from Climate watch requires a few modifications for analysis. The data is first in wide format and needs to have data gathered by Country and Year so that the longitudinal data can be more easily analyzed and explored. Using the gather function we can transpose the year columns into a single column by country and add a new column “co2_em” for CO2 emissions. Next, we need to add iso3c country codes to allow for joining of multiple country wide data set using the mutate function. This new transformation will be stored in a new table called sov_debt which is what will be used for our final file. Finally, lets reorganize the columns so that the data table is easier to read with all the country data on the left and new columns can be added to the right.
# A tibble: 5,626 × 7
country iso3c country_name flag unit year co2_em
<chr> <chr> <chr> <chr> <chr> <dbl> <chr>
1 China CHN China "\U0001f1e8\U0001f1f3" MtCO2e 1990 2891.73
2 United States USA United States "\U0001f1fa\U0001f1f8" MtCO2e 1990 5417.32
3 India IND India "\U0001f1ee\U0001f1f3" MtCO2e 1990 1002.56
4 Indonesia IDN Indonesia "\U0001f1ee\U0001f1e9" MtCO2e 1990 1226.82
5 Russia RUS Russia "\U0001f1f7\U0001f1fa" MtCO2e 1990 2648.36
6 Brazil BRA Brazil "\U0001f1e7\U0001f1f7" MtCO2e 1990 1638.68
7 Japan JPN Japan "\U0001f1ef\U0001f1f5" MtCO2e 1990 1106.26
8 Iran IRN Iran "\U0001f1ee\U0001f1f7" MtCO2e 1990 304.22
9 Canada CAN Canada "\U0001f1e8\U0001f1e6" MtCO2e 1990 606.91
10 Saudi Arabia SAU Saudi Arabia "\U0001f1f8\U0001f1e6" MtCO2e 1990 241.01
# … with 5,616 more rows
Adding total GHG EDGAR Emissions
In addition to CO2 emissions, the PCAF taxonomy metrics are inclusive of additional greenhouse gases (GHGs). To add these, we will need to load in the data set, add iso3 codes and join the data to the sov_debt file. Once we’ve added the data and iso3 codes like in the script above, we can now use a left table join to add these new years and country GHGs to the data set
# A tibble: 18,512 × 6
country iso3c country_name flag year co2
<chr> <chr> <chr> <chr> <dbl> <dbl>
1 International Aviation <NA> <NA> <NA> 1970 1.72e+2
2 International Shipping <NA> <NA> <NA> 1970 3.76e+2
3 Afghanistan AFG Afghanistan "\U0001f1e6\U00… 1970 1.71e+1
4 Albania ALB Albania "\U0001f1e6\U00… 1970 8.12e+0
5 Algeria DZA Algeria "\U0001f1e9\U00… 1970 5.51e+1
6 Angola AGO Angola "\U0001f1e6\U00… 1970 1.98e+1
7 Anguilla AIA Anguilla "\U0001f1e6\U00… 1970 4.67e-3
8 Antigua and Barbuda ATG Antigua & Barbuda "\U0001f1e6\U00… 1970 3.86e-1
9 Argentina ARG Argentina "\U0001f1e6\U00… 1970 2.24e+2
10 Armenia ARM Armenia "\U0001f1e6\U00… 1970 1.36e+1
# … with 18,502 more rows
Now joining tables together using left_join() -
# A tibble: 5,626 × 8
country iso3c country_name flag unit year co2_em co2
<chr> <chr> <chr> <chr> <chr> <dbl> <chr> <dbl>
1 China CHN China "\U0001f1e8\U0001… MtCO… 1990 2891.… 4018.
2 United States USA United States "\U0001f1fa\U0001… MtCO… 1990 5417.… 6199.
3 India IND India "\U0001f1ee\U0001… MtCO… 1990 1002.… 1421.
4 Indonesia IDN Indonesia "\U0001f1ee\U0001… MtCO… 1990 1226.… 422.
5 Russia RUS Russia "\U0001f1f7\U0001… MtCO… 1990 2648.… 3090.
6 Brazil BRA Brazil "\U0001f1e7\U0001… MtCO… 1990 1638.… 702.
7 Japan JPN Japan "\U0001f1ef\U0001… MtCO… 1990 1106.… 1316.
8 Iran IRN Iran "\U0001f1ee\U0001… MtCO… 1990 304.22 328.
9 Canada CAN Canada "\U0001f1e8\U0001… MtCO… 1990 606.91 582.
10 Saudi Arabia SAU Saudi Arabia "\U0001f1f8\U0001… MtCO… 1990 241.01 235.
# … with 5,616 more rows
Adding Exports/Imports from OECD
OECD data set is in wide, Excel format and needs to be tidied so it can be analyzed for Scope 1, 2, and 3 emissions.
# A tibble: 2,064 × 7
code country year country_ghg_all iso3c country_name flag
<chr> <chr> <dbl> <dbl> <chr> <chr> <chr>
1 Country <NA> 1995 NA <NA> <NA> <NA>
2 WLD World 1995 21367. <NA> <NA> <NA>
3 OECD OECD member countries 1995 13016. <NA> <NA> <NA>
4 AUS Australia 1995 278 AUS Australia "\U00…
5 AUT Austria 1995 85.1 AUT Austria "\U00…
6 BEL Belgium 1995 130. BEL Belgium "\U00…
7 CAN Canada 1995 409. CAN Canada "\U00…
8 CHL Chile 1995 39.9 CHL Chile "\U00…
9 COL Colombia 1995 65.5 COL Colombia "\U00…
10 CRI Costa Rica 1995 8.1 CRI Costa Rica "\U00…
# … with 2,054 more rows
# A tibble: 5,626 × 10
country iso3c country_name flag unit year co2_em co2 code count…¹
<chr> <chr> <chr> <chr> <chr> <dbl> <chr> <dbl> <chr> <dbl>
1 China CHN China "\U0… MtCO… 1990 2891.… 4018. <NA> NA
2 United States USA United Stat… "\U0… MtCO… 1990 5417.… 6199. <NA> NA
3 India IND India "\U0… MtCO… 1990 1002.… 1421. <NA> NA
4 Indonesia IDN Indonesia "\U0… MtCO… 1990 1226.… 422. <NA> NA
5 Russia RUS Russia "\U0… MtCO… 1990 2648.… 3090. <NA> NA
6 Brazil BRA Brazil "\U0… MtCO… 1990 1638.… 702. <NA> NA
7 Japan JPN Japan "\U0… MtCO… 1990 1106.… 1316. <NA> NA
8 Iran IRN Iran "\U0… MtCO… 1990 304.22 328. <NA> NA
9 Canada CAN Canada "\U0… MtCO… 1990 606.91 582. <NA> NA
10 Saudi Arabia SAU Saudi Arabia "\U0… MtCO… 1990 241.01 235. <NA> NA
# … with 5,616 more rows, and abbreviated variable name ¹country_ghg_all
Creating Scope Emissions
WB Data
Show the code
## Join in relevant WB data
scope_1_2_3_wbnominal<-scope_1_2_3 |>
inner_join(wb_gdp_nominal_clean)Show the code
sov_debt_1_2_3_allgdp<-scope_1_2_3_wbnominal |>
inner_join(wb_gdp_ppp_clean)Show the code
sov_debt<-sov_debt_1_2_3_allgdp |>
inner_join(wb_population_clean)Create .CSV File of Data
Show the code
write_csv(sov_debt, here("week_7", "sov_debt.csv"))Limitations
Metadata could have been attached, formatted, saved more thoroughly
Calculations could have been added for imputed columns
To preserve data integrity, additional column(s) could be added that clarifies the source & metadata