Global Debt Database - GDD

Data - IMF

date

Code
GDD %>%
  group_by(date) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(date)) %>%
  print_table_conditional()

variable

Code
GDD %>%
  left_join(variable, by = "variable") %>%
  group_by(variable, Variable) %>%
  summarise(Nobs = n()) %>%
  print_table_conditional()
variable Variable Nobs
cg Central government debt, % of GDP 7631
gg General government debt, % of GDP 3029
hh_all Household debt, all instruments, % of GDP 986
hh_ls Household debt, loans and debt securities, % of GDP 2285
nfc_all Nonfinancial corporate debt, all instruments, % of GDP 986
nfc_ls Nonfinancial corporate debt, loans and debt securities, % of GDP 2267
nfps Nonfinancial public sector debt, % of GDP 396
ngdp Nominal gross domestic product, billions in national currency 11044
ps Public sector debt, % of GDP 383
pvd_all Private debt, all instruments, % of GDP 986
pvd_ls Private debt, loans and debt securities, % of GDP 7543

Private debt, all instruments, % of GDP

Nobs

Code
GDD %>%
  filter(variable == "pvd_all") %>%
  group_by(country) %>%
  summarise(Nobs = n(),
            first = first(date),
            last = last(date)) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", country))),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

Private debt, loans and debt securities, % of GDP

Nobs

Code
GDD %>%
  filter(variable == "pvd_ls") %>%
  group_by(country) %>%
  summarise(Nobs = n(),
            first = first(date),
            last = last(date)) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", country))),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

Italy, United States, Switzerland

Code
GDD %>%
  filter(variable == "pvd_ls",
         country %in% c("Italy", "United States", "Switzerland")) %>%
  left_join(colors, by = "country") %>%
  ggplot(.) + geom_line(aes(x = date, y = value / 100, color = color)) +
  theme_minimal() + scale_color_identity() +
  geom_image(data = . %>%
               filter(date == as.Date("1960-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", country)), ".png")),
             aes(x = date, y = value/100, image = image), asp = 1.5) +
  scale_y_continuous(breaks = 0.01*seq(0, 260, 20),
                     labels = scales::percent_format(accuracy = 1)) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2020, 10), "-01-01")),
               labels = date_format("%y")) + 
  xlab("") + ylab("Private Debt, loans and securities (% of GDP)")

Germany, Argentina, Portugal

Code
GDD %>%
  filter(variable == "pvd_ls",
         country %in% c("Germany", "Argentina", "Portugal")) %>%
  left_join(colors, by = "country") %>%
  ggplot(.) + geom_line(aes(x = date, y = value / 100, color = color)) +
  theme_minimal() + scale_color_identity() +
  geom_image(data = . %>%
               filter(date == as.Date("2019-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", country)), ".png")),
             aes(x = date, y = value/100, image = image), asp = 1.5) +
  scale_y_continuous(breaks = 0.01*seq(0, 260, 20),
                     labels = scales::percent_format(accuracy = 1)) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2020, 10), "-01-01")),
               labels = date_format("%y")) + 
  xlab("") + ylab("Private Debt, loans and securities (% of GDP)")