Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The objective of the visualisation was to showcase which countries actually own the most U.S. debt and how big those debts are in a single plot.
Knowing the country’s debt is important. The majority of countries have defaulted at least once in their lifetime. Governments tend to default for a variety of different reasons and its implications are ranging from a simple reversal of global capital flows to weak revenues to currency devaluation. For instance, as a country’s debt-to-GDP ratio rises, it often signals that a recession is underway. Sometimes implications can also be far stretched. For instance, if a country devalues its currency to pay its debt, the lower currency valuation makes their products cheaper for export and helps its manufacturing industry. However, this visualisation is not about predicting sovereign defaults as it is extremely difficult, but more of an important measure to monitor to understand the macroeconomic landscape, and to assess potential challenges and opportunities.
So, the intended target audience for this visualization would be market analysts, financial specialists, rating agencies, retail and institutional investors, traders, government authorities, and policymakers.
The visualisation had the following three main issues:
Inability to amplify cognition:
Not helping in communicating the key data insight (the “so what” question):
Irrelevant use of colour coding:
Reference
For reconstruction, I have used the updated debt data from the original source U.S. Department of the Treasury [1]. I have integrated additional GDP data to calculate US Debt to GDP ratio; I have retrieved 2020 GDP data from the International Monetary Fund[2].
The following code was used to fix the issues identified in the original.
library(ggplot2)
library(tidyr)
library(dplyr)
library(readxl)
debt_data<- read_excel("Debt_data.xlsx")
gdp_data <- read_excel("GDP_Data.xlsx")
gdp_data$GDP <- as.numeric(gdp_data$GDP)
#joining debt_data and gdp_data using the country name
debt_gdp_data <- debt_data %>% left_join(gdp_data, by = "Country")
debt_gdp_data $Debt_June_2020 <- as.numeric(debt_gdp_data $Debt_June_2020)
#Creating a new variable debt to gdp ratio by diving debt to country's GDP.
debt_gdp_data <- debt_gdp_data %>% mutate(debt_gdp = (Debt_June_2020/GDP))
#Creating debt to gdp ratio categories of <20%, 20% to <40%, 40% to <60%, 60% to <80%, 80%+
debt_gdp_data <- debt_gdp_data %>%
mutate(debt_gdp_ratio =
cut(debt_gdp, breaks=c(0,0.2,0.4,0.6,0.8,50),
labels=c("<20%","20% to <40%", "40% to <60%", "60% to <80%", "80%+")))
#Rounding debt values
debt_gdp_data$Debt_June_2020 <- round(debt_gdp_data$Debt_June_2020)
#Plotting the data
Debt_plot <-ggplot(data = debt_gdp_data,
mapping = aes(x = reorder(Country, Debt_June_2020),
y = Debt_June_2020)) + theme_bw() +
#plot type
geom_bar(stat = "identity", aes(fill = debt_gdp_ratio), position = "dodge",width=0.8) +
#Selecting colours which are slightly meaningful and freindly to people with colourblindness
scale_fill_manual(values = c("darkseagreen3", "skyblue1", "cyan3", "burlywood1", "tomato2"),
na.value = "grey50")+
geom_text(aes(label=Debt_June_2020), hjust="left", color="Black", size=3.2) +
coord_flip() +
#customising the non-data components of the plot; i.e. theme
theme(panel.border = element_blank(),
strip.text.y = element_text(angle = 180,size=10,face = 'bold'),
axis.text.x=element_text(size = 9.5),
axis.text.y=element_text(size = 9.5)) +
#customising the legent theme
theme(
legend.title = element_text(size = 10, face = "bold"),
legend.position="right",
legend.key.height = unit(0.6, "cm"),
legend.key.width = unit(0.6, "cm"),
legend.direction="vertical")+
#customising Labels
xlab("Country") +
ylab("Debt in USD Billion") +
guides(fill=guide_legend(title="Debt(US) to GDP Ratio"))+
labs(title = "Foreign Holders of U.S. Debt 2020", subtitle = "Countries Owning U.S. Debt in Billions of Dollars and their Debt(US) to GDP Ratio",
caption = "*Data as of June 2020
Article and Sources:
https://howmuch.net/articles/foreign-holders-of-us-debt-2020
U.S. Department of the Treasury - https://home.treasury.gov/
IMF - https://www.imf.org/external/pubs/ft/weo/2020/01/weodata/index.aspx") +
#Moving caption to the left and making title bold
theme(plot.caption = element_text(hjust = 0), plot.title = element_text(face = "bold"))
Data Reference
[1]U.S. Department of the Treasury. Major Foreign Holders of Treasury Securities. Data retrieved on September 08, 2020, via website https://ticdata.treasury.gov/Publish/mfh.txt
[2]International Monetary Fund. 2020. World Economic Outlook Database, April 2020. Custom data retrieved on September 08, 2020, via website https://www.imf.org/external/pubs/ft/weo/2020/01/weodata/weoselco.aspx?g=2001&sg=All+countries
The following plot fixes the main issues in the original.