#Create folder path for data access
folder_path <- partial(here, "03_data_processed")
folder_path() %>% list.files()
## [1] "country_features_2022-10.csv" "emissions_dataset_full.csv"
## [3] "emissions_dataset.csv" "Green_bond_full_dataset.csv"
## [5] "imf_weo_by_country_2022_oct.csv"
#Import data
emissions_dataset <- folder_path("emissions_dataset.csv") %>%
read_csv()
## New names:
## Rows: 2820 Columns: 32
## ── Column specification
## ────────────────────────────────────────────────────────
## Delimiter: "," chr (3): country_name, iso3c, em_dm dbl (29): ...1, year,
## gdp_usd_current_prices, gdp_ppp_current_prices, gdp_pc...
## ℹ 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.
## • `` -> `...1`
emissions_dataset_full <- folder_path("emissions_dataset_full.csv") %>%
read_csv()
## New names:
## Rows: 6702 Columns: 32
## ── Column specification
## ────────────────────────────────────────────────────────
## Delimiter: "," chr (1): iso3c dbl (31): ...1, year, gdp_usd_current_prices,
## gdp_ppp_current_prices, gdp_pc...
## ℹ 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.
## • `` -> `...1`
imf_weo_by_country_2022 <- folder_path("imf_weo_by_country_2022_oct.csv") %>%
read_csv()
## New names:
## Rows: 414000 Columns: 10
## ── Column specification
## ────────────────────────────────────────────────────────
## Delimiter: "," chr (7): country_name, iso3c, short_name_unit, short_name,
## short_unit, categ... dbl (3): ...1, year, value
## ℹ 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.
## • `` -> `...1`
country_features_2022 <- folder_path("country_features_2022-10.csv") %>%
read_csv()
## New names:
## Rows: 217 Columns: 9
## ── Column specification
## ────────────────────────────────────────────────────────
## Delimiter: "," chr (4): country_name, iso3c, wb_income_group, wb_region dbl
## (5): ...1, debt_gross_percent_of_gdp, nominal_gdp_bn_ppp, nominal_gdp_pe...
## ℹ 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.
## • `` -> `...1`
Green_bond_full_dataset <- folder_path("Green_bond_full_dataset.csv") %>%
read_csv()
## New names:
## Rows: 5006 Columns: 21
## ── Column specification
## ────────────────────────────────────────────────────────
## Delimiter: "," chr (18): description, maturity_date, coupon_class, currency,
## ESG_bond_type,... dbl (3): ...1, amount_outstanding_usd, issued_amount_usd
## ℹ 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.
## • `` -> `...1`
#Get subsets of Green_bond_full_dataset
green_bond_issued_amount_10 <- Green_bond_full_dataset %>%
group_by(country_of_issue) %>%
summarize(issued_amount_usd = sum(issued_amount_usd)) %>%
arrange(desc(issued_amount_usd)) %>%
slice (1:10)
green_bond_outstanding_amount_10 <- Green_bond_full_dataset %>%
group_by(country_of_issue) %>%
summarize(amount_outstanding_usd = sum(amount_outstanding_usd)) %>%
arrange(desc(amount_outstanding_usd)) %>%
slice (1:10)
#Define gppr_theme() function
theme_gppr <- function(){
font <- "Georgia" #assign font family up front
theme_pander() %+replace% #replace elements we want to change
theme(
#text elements
plot.title = element_text( #title
family = font, #set font family
size = 11, #set font size
face = 'bold', #bold typeface
hjust = 0, #left align
vjust = 0), #raise slightly
plot.subtitle = element_text( #subtitle
family = font, #font family
size = 9), #font size
plot.caption = element_text( #caption
family = font, #font family
size = 9, #font size
hjust = 1), #right align
axis.title = element_text( #axis titles
family = font, #font family
size = 9), #font size
axis.text = element_text( #axis text
family = font, #axis famuly
size = 9), #font size
axis.text.x = element_text( #margin for axis text
margin=margin(5, b = 10),
size = 9)
)
}
The context of the study
Data sets used
The outline of the study
Key findings
According to Refinitiv, the top ten countries with the highest value of green bond issuance as of October 2022 are (from high to low): the United States, China, France, Germany, Canada, the United Kingdom, Japan, Sweden, Norway, and Australia. From an issuing country perspective, the concentration of green bond issuance is apparent, with the top two countries, the US and China, far ahead of the rest in terms of combined issuance value. At the same time, any one of the top four countries has more than double the value of green bond issuance of the remaining countries individually.
In addition, the top ten countries with the highest green bond outstanding values show the same trend, which can be cross-checked with the above.
#Horizontal barplot in terms of Top 10 countries with the highest issuance amount of green bonds
ggplot(green_bond_issued_amount_10, aes(x = reorder(country_of_issue,round(issued_amount_usd/1000000,2)), y = round(issued_amount_usd/1000000,2))) +
geom_bar(stat = 'identity',fill = "#9DC183") +
coord_flip() +
scale_y_continuous(labels = dollar) +
labs(
x = "",
y = "Issued amount of Green bonds in USD (Millions)",
title = "Who are the largest issuers of green bonds?",
subtitle = "Top 10 countries with the highest issuance amount of green bonds",
caption = "Data source: Refinitiv"
)+
theme_gppr()
#Horizontal barplot in terms of top 10 countries with the highest outstanding amount of green bonds
ggplot(green_bond_outstanding_amount_10, aes(x = reorder(country_of_issue,round(amount_outstanding_usd/1000000,2)), y = round(amount_outstanding_usd/1000000,2))) +
geom_bar(stat = 'identity',fill = "#9DC183") +
coord_flip() +
scale_y_continuous(labels = dollar) +
labs(
x = "",
y = "Outstanding amount of Green bonds in USD (Millions)",
title = "Who are the largest issuers of green bond?",
subtitle = "Top 10 countries with the highest outstanding amount of green bonds",
caption = "Data source: Refinitiv"
)+
theme_gppr()
#Get a subset of Green_bond_full_dataset
green_bond_issued_and_outstanding <- Green_bond_full_dataset %>%
group_by(country_of_issue) %>%
summarize(issued_amount_usd = sum(issued_amount_usd),
amount_outstanding_usd = sum(amount_outstanding_usd)) %>%
arrange(desc(amount_outstanding_usd))
#Lollipop plot to stress the differences between issue amount and outstanding amount of green bonds
ggplot(green_bond_issued_and_outstanding) +
geom_segment( aes(x=country_of_issue, xend=country_of_issue, y=round(amount_outstanding_usd/1000000,2), yend=round(issued_amount_usd/1000000,2)), color="grey") +
geom_point( aes(x=country_of_issue, y=round(amount_outstanding_usd/1000000,2)), color="#9DC183", size=1 ) +
geom_point( aes(x=country_of_issue, y=round(issued_amount_usd/1000000,2)), color="#043927", size=1 ) +
coord_flip()+
scale_y_continuous(limits = c(0, 25000),labels = dollar) +
theme_gppr() +
theme(
legend.position = "none",
) +
xlab("") +
ylab("Amount of Green Bonds in USD (Millions)")
## Warning: Removed 7 rows containing missing values (geom_segment).
## Warning: Removed 7 rows containing missing values (geom_point).
## Removed 7 rows containing missing values (geom_point).
#join country_features_2022 and get a subset of Green_bond_full_dataset
green_bond_country_features_sum <- Green_bond_full_dataset %>%
left_join(country_features_2022, by = "iso3c") %>%
group_by(country_of_issue, wb_income_group, wb_region, )%>%
summarize(issued_amount_usd = sum(issued_amount_usd),
amount_outstanding_usd = sum(amount_outstanding_usd))
## `summarise()` has grouped output by 'country_of_issue', 'wb_income_group'. You
## can override using the `.groups` argument.
#Group by income & region
green_bond_sum_by_income <- green_bond_country_features_sum %>%
group_by(wb_income_group) %>%
summarize(issued_amount_usd = sum(issued_amount_usd),
amount_outstanding_usd = sum(amount_outstanding_usd))
green_bond_sum_by_region<- green_bond_country_features_sum %>%
group_by(wb_region) %>%
summarize(issued_amount_usd = sum(issued_amount_usd),
amount_outstanding_usd = sum(amount_outstanding_usd))
#Barchart for income group
ggplot(green_bond_sum_by_income, aes(x = reorder(wb_income_group,-round(issued_amount_usd/1000000,2)), y = round(issued_amount_usd/1000000,0))) +
geom_bar(stat = 'identity',fill = "#9DC183") +
scale_y_continuous(labels = dollar) +
geom_text(aes(label = paste(round(issued_amount_usd/1000000,0),'M',sep=''),
vjust=-0.5,
family = 'Georgia'),
size = 2.7) +
labs(
x = "Income Groups",
y = "Issued amount of Green bonds in USD (Millions)",
title = "Comparing differences in green bond issuance across country groups",
subtitle = "Total issued amount of green bonds in different income groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()
#Barchart for region
ggplot(green_bond_sum_by_region, aes(x = reorder(wb_region,round(issued_amount_usd/1000000,2)), y = round(issued_amount_usd/1000000,0))) +
geom_bar(stat = 'identity',fill = "#9DC183") +
coord_flip() +
scale_y_continuous(labels = dollar) +
geom_text(aes(label = paste(round(issued_amount_usd/1000000,0),'M',sep=''),
hjust=0.3,
family = 'Georgia'),
size = 2.0) +
labs(
x = "Region Groups",
y = "Issued amount of Green bonds in USD (Millions)",
title = "Comparing differences in green bond issuance across country groups",
subtitle = "Total issued amount of green bonds in different region groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()
#join country_features_2022 and get a subset of Green_bond_full_dataset
green_bond_country_features <- Green_bond_full_dataset %>%
left_join(country_features_2022, by = "iso3c") %>%
group_by(country_of_issue, wb_income_group, wb_region)%>%
summarize(issued_amount_usd_mean = mean(issued_amount_usd),
amount_outstanding_usd_mean = mean(amount_outstanding_usd))
## `summarise()` has grouped output by 'country_of_issue', 'wb_income_group'. You
## can override using the `.groups` argument.
ggplot(green_bond_country_features, aes(x=round(issued_amount_usd_mean/1000000,2), group= wb_region, fill=wb_income_group)) +
geom_density(adjust=1.5) +
scale_fill_viridis(discrete=TRUE) +
scale_color_viridis(discrete=TRUE) +
facet_wrap(~wb_region) +
labs(
x = "Average issued amount of green bonds in USD (Millions)",
y = "",
title = "Comparing differences in green bond issuance across countries",
subtitle = "The distribution of average issuance amount of green bonds for different region groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()+
theme(
legend.position="none",
panel.spacing = unit(0.1, "lines"),
axis.ticks.x=element_blank()
)
## Warning: Groups with fewer than two data points have been dropped.
## Warning in max(ids, na.rm = TRUE): max里所有的参数都不存在;回覆-Inf
ggplot(green_bond_country_features, aes(x=round(issued_amount_usd_mean/1000000,2), group= wb_income_group, fill=wb_income_group)) +
geom_density(adjust=1.5) +
scale_fill_viridis(discrete=TRUE) +
scale_color_viridis(discrete=TRUE) +
facet_wrap(~wb_income_group) +
labs(
x = "Average issued amount of green bonds in USD (Millions)",
y = "",
title = "Comparing differences in green bond issuance across countries",
subtitle = "The distribution of average issuance amount of green bonds for different income groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()+
theme(
legend.position="none",
panel.spacing = unit(0.1, "lines"),
axis.ticks.x=element_blank()
)
#generate ridgeline plot for income groups
ggplot(green_bond_country_features, aes(x = round(issued_amount_usd_mean/1000000,2), y = wb_income_group, fill = wb_income_group, height = ..density..)) +
geom_density_ridges(scale = 3, rel_min_height = 0.005, stat = "density") +
scale_y_discrete(expand = c(0.01, 0)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_colour_brewer(palette = "Greens")+
labs(
x = "Average issued amount of green bonds in USD (Millions)",
y = "",
title = "Comparing differences in green bond issuance across countries",
subtitle = "The distribution of average issuance amount of green bonds for different income groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr() +
theme(
legend.position="none"
)
#generate ridgeline plot for region groups
ggplot(green_bond_country_features, aes(x = round(issued_amount_usd_mean/1000000,2), y = wb_region, fill = wb_region, height = ..density..)) +
geom_density_ridges(scale = 3, rel_min_height = 0.005, stat = "density") +
scale_y_discrete(expand = c(0.01, 0)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_colour_brewer(palette = "Greens")+
labs(
x = "Average issued amount of green bonds in USD (Millions)",
y = "",
title = "Comparing differences in green bond issuance across countries",
subtitle = "The distribution of average issuance amount of green bonds for different region groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr() +
theme(
legend.position="none",
)
## Warning: Groups with fewer than two data points have been dropped.
#join country_features_2022 and get a subset of Green_bond_full_dataset
green_bond_country_features_cbi <- Green_bond_full_dataset %>%
left_join(country_features_2022, by = "iso3c") %>%
group_by(country_of_issue, wb_income_group, wb_region, ESG_bond_type) %>%
summarize(issued_amount_usd = sum(issued_amount_usd),
amount_outstanding_usd = sum(amount_outstanding_usd)) %>%
arrange(desc(amount_outstanding_usd))
## `summarise()` has grouped output by 'country_of_issue', 'wb_income_group',
## 'wb_region'. You can override using the `.groups` argument.
#Grouped barchart for income group
ggplot(green_bond_country_features_cbi, aes(fill=ESG_bond_type, y=round(issued_amount_usd/1000000,0), x=reorder(wb_income_group,-round(issued_amount_usd/1000000,0)))) +
geom_bar(position="stack", stat="identity") +
scale_fill_viridis(discrete = T) +
scale_y_continuous(labels = dollar) +
labs(
x = "Income Groups",
y = "Issued amount of Green bonds in USD (Millions)",
title = "ESG bond types across country groups",
subtitle = "Issued amount of different green bond types in different income groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()
#Percent stacked barchart for income group
ggplot(green_bond_country_features_cbi, aes(fill=ESG_bond_type, y=round(issued_amount_usd/1000000,0), x=reorder(wb_income_group,-round(issued_amount_usd/1000000,0)))) +
geom_bar(position="fill", stat="identity")+
scale_fill_viridis(discrete = T) +
labs(
x = "Income Groups",
y = "Percentage of green bonds",
title = "ESG bond types across country groups",
subtitle = "Percentage of different green bond types in different income groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()
#Grouped barchart for region group
ggplot(green_bond_country_features_cbi, aes(fill=ESG_bond_type, y=round(issued_amount_usd/1000000,0), x=reorder(wb_region,round(issued_amount_usd/1000000,0)))) +
geom_bar(position="stack", stat="identity") +
coord_flip() +
scale_fill_viridis(discrete = T) +
scale_y_continuous(labels = dollar) +
labs(
x = "Income Groups",
y = "Issued amount of Green bonds in USD (Millions)",
title = "ESG bond types across country groups",
subtitle = "Issued amount of different green bond types in different income groups",
caption = "Data source: Refinitiv, IMF"
) +
theme_gppr()
#Percent stacked barchart for region group
ggplot(green_bond_country_features_cbi, aes(fill=ESG_bond_type, y=round(issued_amount_usd/1000000,0), x=reorder(wb_region,round(issued_amount_usd/1000000,0)))) +
geom_bar(position="fill", stat="identity")+
coord_flip() +
scale_fill_viridis(discrete = T) +
labs(
x = "Region Groups",
y = "Percentage of green bonds",
title = "ESG bond types across country groups",
subtitle = "Percentage of different green bond types in different region groups",
caption = "Data source: Refinitiv, IMF"
)+
theme_gppr()
#join country_features_2022 and get a subset of Green_bond_full_dataset
green_bond_country_features_cbi_type <- Green_bond_full_dataset %>%
left_join(country_features_2022, by = "iso3c") %>%
group_by(country_of_issue, wb_income_group, wb_region, ESG_bond_type)
#Count obs in green_bond_country_features_cbi
green_bond_country_features_cbi_n <- green_bond_country_features_cbi_type %>%
count(wb_income_group, wb_region, ESG_bond_type)
#generate alluvial plot
ggplot(data = green_bond_country_features_cbi_n,
aes(axis1 = wb_income_group, axis2 = ESG_bond_type, axis3 = wb_region, y = n), width = 0.5, knot.pos = 0.8, alpha = 0.8) +
geom_alluvium(aes(fill = ESG_bond_type)) +
geom_stratum(width = 0.6) +
geom_text(stat = "stratum",
aes(label = after_stat(stratum)), size= 1.8) +
scale_x_discrete(limits = c("Income group", "ESG bond type", "Region"),
expand = c(0.8, 0.8)) +
scale_fill_viridis_d() +
labs(
x = "",
y = "",
caption = "Data source: Refinitiv, IMF"
)+
theme_void() +
theme(
legend.position="none",
)+
guides(fill = guide_legend(title = "ESG bond type"))
#Get a subset of TRBC sector
#Get subsets and join and clean
cumulative_co2_per_capita <- emissions_dataset_full %>%
filter(year == 2019) %>%
select(iso3c, cumulative_co2_per_capita)
green_bond_issued_amount <- Green_bond_full_dataset %>%
group_by(country_of_issue, iso3c) %>%
summarize(issued_amount_usd = sum(issued_amount_usd))
## `summarise()` has grouped output by 'country_of_issue'. You can override using
## the `.groups` argument.
emission_gdp_green_bond <- green_bond_issued_amount %>%
left_join(cumulative_co2_per_capita, by = "iso3c") %>%
left_join(country_features_2022, by = "iso3c")
emission_gdp_green_bond_clean <- emission_gdp_green_bond %>%
filter(!is.na(cumulative_co2_per_capita))
# Interactive version data set
interactive_emission_gdp_green_bond <- emission_gdp_green_bond_clean %>%
mutate(gdpPercap=round(nominal_gdp_bn_ppp,0)) %>%
mutate(pop=round(population_mn,2)) %>%
mutate(cumulative_co2_per_capita=round(cumulative_co2_per_capita,1)) %>%
mutate(green_bound_issued=round(issued_amount_usd/1000000,0)) %>%
# Reorder countries
arrange(desc(green_bound_issued)) %>%
# prepare text for tooltip
mutate(text = paste("Country: ", country_of_issue, "\nRegion: ", wb_region, "\nPopulation (M): ", pop, "\nCumulative CO2 per capita: ", cumulative_co2_per_capita, "\nGdp per capita (B): ", gdpPercap, "\nGreen bond issue amount (M): ", green_bound_issued, sep="")) %>%
# Classic ggplot
ggplot( aes(x=gdpPercap, y=cumulative_co2_per_capita, size = green_bound_issued, color = wb_region, text=text)) +
geom_point(alpha=0.7) +
scale_size(range = c(1, 30), name="Green bond issue amount (M)") +
scale_color_viridis(discrete=TRUE,guide=FALSE) +
labs(
x = "Gdp per capita (B)",
y = "Cumulative CO2 per capita",
caption = "Data source: Refinitiv, Our World In Data, IMF"
)+
theme_gppr() +
theme(legend.position="none")
# turn ggplot interactive with plotly
interactive_emission_gdp_green_bond_output <- ggplotly(interactive_emission_gdp_green_bond, tooltip="text")
interactive_emission_gdp_green_bond_output