Untitled

Question Formation + Exploratory Data Analysis

  1. Who are the countries that have expressed needs for climate finance? Which ones have the largest needs? For what reason?
library(writexl)
Warning: package 'writexl' was built under R version 4.3.3
library(countrycode)
Warning: package 'countrycode' was built under R version 4.3.3
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.3.3
Warning: package 'ggplot2' was built under R version 4.3.3
Warning: package 'tibble' was built under R version 4.3.3
Warning: package 'tidyr' was built under R version 4.3.3
Warning: package 'readr' was built under R version 4.3.3
Warning: package 'purrr' was built under R version 4.3.3
Warning: package 'dplyr' was built under R version 4.3.3
Warning: package 'stringr' was built under R version 4.3.3
Warning: package 'forcats' was built under R version 4.3.3
Warning: package 'lubridate' was built under R version 4.3.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.0     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ 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(janitor) 

Attaching package: 'janitor'

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

    chisq.test, fisher.test
library(countrycode)
library(ggplot2)
library(hrbrthemes)
Warning: package 'hrbrthemes' was built under R version 4.3.3
library(viridis)
Loading required package: viridisLite
Warning: package 'viridisLite' was built under R version 4.3.3
library(readxl)
Warning: package 'readxl' was built under R version 4.3.3
library(here)
here() starts at C:/Users/owner/Desktop/Sustainable Finance/Final paper/Final paper
all_hands_bloomberg <- read_csv("C:/Users/owner/Desktop/Sustainable Finance/R/climate_finance_needs.csv")
Rows: 196 Columns: 25
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr  (7): country_name, iso3c, region_name, sub_region_name, annex_1, report...
dbl (18): least_developed_countries_ldc, land_locked_developing_countries_ll...

ℹ 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.
top_countries <- all_hands_bloomberg %>%
    group_by(country_name) %>%
  summarise(total = sum(total)) %>%
  arrange(desc(total)) %>%
  top_n(10)
Selecting by total
other_countries <- all_hands_bloomberg %>%
  filter(!country_name %in% top_countries$country_name) %>%
  summarise(total = sum(total, na.rm = TRUE)) %>%
  mutate(country_name = "Others combined")

# Combine top countries and other countries data
combined_data <- bind_rows(top_countries, other_countries)

combined_data$country_name <- factor(
  combined_data$country_name,
  levels = c(top_countries$country_name, "Others combined")
)

chart1 <- combined_data |>
  ggplot(aes(x=country_name, y=total)) +
  geom_bar(stat="identity") +
  geom_col() +
  theme(legend.position = "",legend.title = element_blank())+
  scale_y_continuous(labels = scales::label_dollar(suffix = " BN")) +
  labs(
    x="",
    y="Expressed climate financing needs",
    caption="Data compiled from national reports submitted to the UNFCCC")+
    xlab("")
chart1

From this particular dataset, tt seems like China, India, and South Africa have way higher climate needs than other countries. Emerging markets seem to have much larger needs than LDCs??

  1. What kind of patterns are there? Are more vulnerable nations asking for more finance?
column_types <- sapply(all_hands_bloomberg, class)
print(column_types)
                         country_name                                 iso3c 
                          "character"                           "character" 
                          region_name                       sub_region_name 
                          "character"                           "character" 
        least_developed_countries_ldc land_locked_developing_countries_lldc 
                            "numeric"                             "numeric" 
  small_island_developing_states_sids                               annex_1 
                            "numeric"                           "character" 
                        unfccc_member                 oda_eligible_oecd_dac 
                            "numeric"                             "numeric" 
                               wb_ida           nd_gain_vulnerability_score 
                            "numeric"                             "numeric" 
                         report_types                 total_number_of_needs 
                          "character"                             "numeric" 
     total_number_of_quantified_needs                                 total 
                            "numeric"                             "numeric" 
                           mitigation                            adaptation 
                            "numeric"                             "numeric" 
                                cross                                 other 
                            "numeric"                             "numeric" 
                     risk_of_distress                            gdp_bn_usd 
                          "character"                             "numeric" 
                   gdp_per_capita_usd                         population_mn 
                            "numeric"                             "numeric" 
                       need_percapita 
                            "numeric" 
chart2 <- all_hands_bloomberg |> 
  select(country_name, iso3c, gdp_bn_usd, gdp_per_capita_usd, total, need_percapita, nd_gain_vulnerability_score, population_mn, least_developed_countries_ldc, small_island_developing_states_sids, region_name, sub_region_name) |> 
  filter(total>0) |> 
  mutate(special_needs = case_when(
    small_island_developing_states_sids == 1 & is.na(least_developed_countries_ldc) ~ "Small Island",
    is.na(small_island_developing_states_sids) & least_developed_countries_ldc == 1 ~ "LDC",
    small_island_developing_states_sids == 1 & least_developed_countries_ldc == 1 ~ "Small Island LDC",
    TRUE ~"Other"  
    ))
  
graph2 <- chart2 |>
  ggplot(aes(x = nd_gain_vulnerability_score, y = need_percapita, color = special_needs)) +
  geom_point(size = 6, alpha = 0.7) +
  theme(legend.position = "bottom",legend.title = element_blank())+
  labs(
    x = "Climate Vulnerability Index",
    y = "Climate Finance Needs per Capita",
    color = ""
  ) +
  scale_y_continuous(labels = scales::label_dollar(suffix = ""))
graph2
Warning: Removed 7 rows containing missing values or values outside the scale range
(`geom_point()`).

It was really hard to draw a relationship between vulnerability to climate change and financing needs… but it does look like the LDCs can be said as a group to be very highly vulnerable and Small island have higher financing needs. The needs data are adjusted for population to compare across different size economies.

  1. Is there a relationship between needs and debt levels?
chart3 <- all_hands_bloomberg |> 
  select(country_name, iso3c, gdp_bn_usd, gdp_per_capita_usd, total, 
         need_percapita, nd_gain_vulnerability_score, population_mn, 
         least_developed_countries_ldc, small_island_developing_states_sids, 
         oda_eligible_oecd_dac,
         region_name, sub_region_name, risk_of_distress) |> 
  filter(total>0) |> 
  mutate(oda = 
           case_when(
              oda_eligible_oecd_dac == 1 ~ "ODA eligible",
              TRUE ~"Not ODA eligible"  
            ))

graph3 <- chart3 |>
  # filter(small_island_developing_states_sids == 1) |>
  filter(!is.na(nd_gain_vulnerability_score)) |>
  mutate(country_name = fct_reorder(as.factor(country_name), need_percapita)) |>
  ggplot(aes(x = country_name, y = need_percapita, fill = risk_of_distress)) +
  geom_col() +
  theme(legend.position = "bottom", legend.title = element_blank()) +
  labs(
    x = "",
    y = "Financing needs",
    caption = "ND-GAIN Vulnerability Index, OECD"
  ) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  guides(fill = guide_legend(title = ""))  # Show legend with custom title
Warning: There was 1 warning in `mutate()`.
ℹ In argument: `country_name = fct_reorder(as.factor(country_name),
  need_percapita)`.
Caused by warning:
! `fct_reorder()` removing 2 missing values.
ℹ Use `.na_rm = TRUE` to silence this message.
ℹ Use `.na_rm = FALSE` to preserve NAs.
graph3
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_col()`).

Exploring relationship between financing needs and debt stress level did not yield particularly good relationships.