SustainableFinance HW4

library(tidyverse)
Warning: package 'dplyr' was built under R version 4.2.3
Warning: package 'stringr' was built under R version 4.2.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(janitor)

Attaching package: 'janitor'

The following objects are masked from 'package:stats':

    chisq.test, fisher.test
library(countrycode)
green_debt <- read_csv( "https://opendata.arcgis.com/datasets/8e2772e0b65f4e33a80183ce9583d062_0.csv") 
Rows: 355 Columns: 42
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (12): Country, ISO2, ISO3, Indicator, Unit, Source, CTS_Code, CTS_Name, ...
dbl (30): ObjectId, F1985, F1986, F1987, F1990, F1991, F1992, F1993, F1994, ...

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Homework Problem 1

Add the region as a variable to green_debt_subset

Calculate the cumulative issuance of green bonds by region;data visualization comparing regional cumulative issuance

green_debt <- green_debt |>
  clean_names() |>
  mutate(region = countrycode(iso2, "iso2c", "continent"), 
         .before = iso2)

green_debt_cumulate <- green_debt |>
  pivot_longer(
    cols = matches("f\\d{4}"),
    names_to = "fiscal_year", 
    values_to = "issuance_bn_usd",
    values_drop_na = TRUE
    )|>
  filter(!is.na(region))|>
  group_by(region) |>
  summarize(cumulative_issuance = sum(issuance_bn_usd)) |>
  ungroup()

ggplot(green_debt_cumulate, aes(x = region, y = cumulative_issuance, fill = region)) +
  geom_text(aes(label = sprintf("%.2f", cumulative_issuance), vjust = -0.5)) +
  geom_col() +
  labs(
    title = "Cumulative issuance of green bonds by region", 
    x = "Region", 
    y = "Issurance of green bonds(Billions of USD)"
    ) +
  theme(plot.title = element_text(face = "bold"))

Homework Problem 2

Use clean_names to make the variable names snake_case

Filter out observations where type_of_issuer is “Not Applicable”

Use the tools to provide actionable insights about green bond issuers.

green_debt_toi <- green_debt |> 
  clean_names() |>
  filter(type_of_issuer != "Not Applicable")

green_debt_toi <- green_debt_toi |>
  pivot_longer(
    cols = matches("f\\d{4}"),
    names_to = "fiscal_year", 
    values_to = "issuance_bn_usd",
    names_transform = readr::parse_number,
    values_drop_na = TRUE
    )

Green bond issuance by difference type of issuers from 2010-2022

green_debt_toi|>
  filter(fiscal_year>=2010)|>
  ggplot(aes(x = fiscal_year, y = issuance_bn_usd, fill = type_of_issuer)) +
  geom_col() +
  labs(
    title = "Green bond issuance by difference type of issuers from 2010-2022", 
    x = "Year", 
    y = "Issurance of green bonds(Billions of USD)"
  ) +
  theme(plot.title = element_text(face = "bold"), 
        axis.text.x = element_text(angle = 30, hjust = 1))

Cumulative issuance of green bonds by type of issue

green_debt_toi_cumulate <- green_debt_toi|>
  group_by(type_of_issuer) |>
  summarize(cumulative_issuance = sum(issuance_bn_usd)) |>
  ungroup()

ggplot(green_debt_toi_cumulate, aes(x = type_of_issuer, y = cumulative_issuance, fill = type_of_issuer)) +
  geom_text(aes(label = sprintf("%.2f", cumulative_issuance), vjust = -0.5)) +
  geom_col() +
  labs(
    title = "Cumulative issuance of green bonds by type of issuer", 
    x = "Type of issuer", 
    y = "Issurance of green bonds(Billions of USD)"
  ) +
  theme(plot.title = element_text(face = "bold"), 
        axis.text.x = element_text(angle = 30, hjust = 1))

Homework Problem 3

Repeat the process from problem 2 for use_of_proceed and for principal_currency

  1. What are green bond proceeds used for?
green_debt_uop <- green_debt |> 
  clean_names() |>
  filter(use_of_proceed != "Not Applicable")|>
  pivot_longer(
    cols = matches("f\\d{4}"),
    names_to = "fiscal_year", 
    values_to = "issuance_bn_usd",
    values_drop_na = TRUE
  )|>
  select(use_of_proceed, fiscal_year, issuance_bn_usd)|>
  filter(!grepl("e", issuance_bn_usd))

unique(green_debt_uop$use_of_proceed)
 [1] "Access to Essential Services"                                                      
 [2] "Acquiring and distribution of vaccine"                                             
 [3] "Acquisition"                                                                       
 [4] "Affordable Basic Infrastructure"                                                   
 [5] "Agriculture"                                                                       
 [6] "Alternative Energy"                                                                
 [7] "Aquatic Biodiversity Conservation"                                                 
 [8] "Capital expenditure"                                                               
 [9] "Capital expenditure/Financing expenses"                                            
[10] "Carbon reduction through reforestation and avoided deforestation"                  
[11] "China Urban Construction"                                                          
[12] "Circular Economy Adapted/Eco-efficient Products, Production Technologies/Processes"
[13] "Clean Transport"                                                                   
[14] "Climate Change Adaptation"                                                         
[15] "E-education programs - Education Projects"                                         
[16] "Economic Development"                                                              
[17] "Electric & Public Power"                                                           
[18] "Eligible Green Projects"                                                           
[19] "Employee stock ownership plan"                                                     
[20] "Energy Efficiency"                                                                 
[21] "Environmental Protection Projects"                                                 
[22] "Environmentally Sustainable Products"                                              
[23] "Equipment Upgrade/Construction"                                                    
[24] "Financing of Subordinated Loan"                                                    
[25] "Funding new technologies to reduce GHS emissions"                                  
[26] "Gas"                                                                               
[27] "General Purpose"                                                                   
[28] "General Purpose/Acquisition"                                                       
[29] "General Purpose/Refinance"                                                         
[30] "General Purpose/Working Capital"                                                   
[31] "Green Construction/Buildings"                                                      
[32] "Higher Education"                                                                  
[33] "Industrial Development"                                                            
[34] "Infrastructure"                                                                    
[35] "Land Preservation"                                                                 
[36] "Merger or Acquisition"                                                             
[37] "Other"                                                                             
[38] "Other Education"                                                                   
[39] "Other Housing"                                                                     
[40] "Other Public Service"                                                              
[41] "Other Transportation"                                                              
[42] "Pandemic"                                                                          
[43] "Pollution Control"                                                                 
[44] "Pollution Prevention & Control"                                                    
[45] "Production/Supply of Cannabis"                                                     
[46] "Project Finance"                                                                   
[47] "Property Expendit (acquisit/development)"                                          
[48] "Redeem Existing Bonds or Securities"                                               
[49] "Refinance/Financing expenses"                                                      
[50] "Renewable Energy Projects"                                                         
[51] "Repay Bank Loan or Bridge Financing"                                               
[52] "Repay Intercompany Debt"                                                           
[53] "Ship finance"                                                                      
[54] "Social Housing/Affordable Housing"                                                 
[55] "Socioeconomic Advancement And Empowerment"                                         
[56] "Solar projects"                                                                    
[57] "Sustainable Development Projects"                                                  
[58] "Sustainable Economic Growth"                                                       
[59] "Sustainable Forestry"                                                              
[60] "Sustainable Management of Land Use"                                                
[61] "Sustainable Management of Living Natural Resources"                                
[62] "Sustainable Transport"                                                             
[63] "Sustainable Water or Wastewater management"                                        
[64] "Terrestrial Biodiversity Conservation"                                             
[65] "The Belt and Road Initiative"                                                      
[66] "Waste Management"                                                                  
[67] "Water & Sewer"                                                                     
[68] "Wind projects"                                                                     
[69] "Working capital"                                                                   

The green bonds proceeds are used in 69 different areas as listed above.

  1. What do we know about the currency of issuance? Is that changing over time?
green_debt_pc <- green_debt |> 
  clean_names() |>
  filter(principal_currency != "Not Applicable") |>
  pivot_longer(
    cols = matches("f\\d{4}"),
    names_to = "fiscal_year", 
    values_to = "issuance_bn_usd",
    values_drop_na = TRUE
  )|>
  select(principal_currency, fiscal_year, issuance_bn_usd)|>
  filter(!grepl("e", issuance_bn_usd))

unique(green_debt_pc$principal_currency)
 [1] "Argentinian Peso"                         
 [2] "Argentinian Unidades de Valor Adquisitivo"
 [3] "Australian Dollar"                        
 [4] "Bangladeshi Taka"                         
 [5] "Brazilian Real"                           
 [6] "British Pound"                            
 [7] "Canadian Dollar"                          
 [8] "Chilean Peso"                             
 [9] "Chilean Unidad de Fomento"                
[10] "Chinese Yuan"                             
[11] "Colombian Peso"                           
[12] "Czech Koruna"                             
[13] "Danish Krone"                             
[14] "Deutsche Mark"                            
[15] "Euro"                                     
[16] "European Currency Unit"                   
[17] "Fijian Dollar"                            
[18] "Hong Kong Dollar"                         
[19] "Hungarian Forint"                         
[20] "Icelandic Krona"                          
[21] "Indian Rupee"                             
[22] "Indonesian Rupiah"                        
[23] "Japanese Yen"                             
[24] "Kazakhstani Tenge"                        
[25] "Macanese Pataca"                          
[26] "Malaysian Ringgit"                        
[27] "Mexican Peso"                             
[28] "Mexican Unidad de Inversion"              
[29] "Moroccan Dirham"                          
[30] "Namibian Dollar"                          
[31] "New Zealand Dollar"                       
[32] "Nigerian Naira"                           
[33] "Norwegian Krone"                          
[34] "Peruvian Sol"                             
[35] "Philippine Peso"                          
[36] "Polish Zloty"                             
[37] "Romanian Leu"                             
[38] "Russian Ruble"                            
[39] "Singapore Dollar"                         
[40] "South African Rand"                       
[41] "South Korean Won"                         
[42] "Sri Lankan Rupee"                         
[43] "Swedish Krona"                            
[44] "Swiss Franc"                              
[45] "Taiwanese Dollar"                         
[46] "Thai Baht"                                
[47] "Turkish Lira"                             
[48] "Ukrainian Hryvnia"                        
[49] "US Dollar"                                
[50] "Vietnamese Dong"                          

There are 50 currency used in the green bond issuance in fiscal year 2022. Before 2022, there has not been any green bonds issuance, so the change overtime cannot be measured.