Government Finance Statistics (GFS), Main Aggregates and Balances - GFSMAB

Data - IMF

INDICATOR

Code
GFSMAB %>%
  left_join(CL_INDICATOR_GFSMAB, by = "INDICATOR") %>%
  group_by(INDICATOR, INDICATOR_desc) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

SECTOR

Code
GFSMAB %>%
  left_join(CL_SECTOR_GFSMAB, by = "SECTOR") %>%
  group_by(SECTOR, SECTOR_desc) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
SECTOR SECTOR_desc Nobs
S1321 NA 126024
S1311B NA 121074
S13 NA 101615
S1313 NA 99830
S1311 NA 99229
S1314 NA 86389
S13112 NA 43131
S1312 NA 30858

iso2c

Code
GFSMAB %>%
  left_join(iso2c, by = "iso2c") %>%
  group_by(iso2c, Iso2c) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

CLASSIFICATION

Code
GFSMAB %>%
  group_by(CLASSIFICATION) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

UNIT

Code
GFSMAB %>%
  left_join(CL_UNIT_GFSMAB, by = "UNIT") %>%
  group_by(UNIT, UNIT_desc) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
UNIT UNIT_desc Nobs
XDC Domestic currency 355764
XDC_R_B1GQ Percent of GDP 352386

Interest Expense

List

Code
GFSMAB %>%
  left_join(CL_SECTOR_GFSMAB, by = "SECTOR") %>%
  left_join(iso2c, by = "iso2c") %>%
  filter(INDICATOR == "G24__Z",
         UNIT == "XDC_R_B1GQ",
         SECTOR == "S1321") %>%
  group_by(iso2c, Iso2c) %>%
  summarise(Nobs = n(),
            year1 = first(year(date)),
            value1 = first(round(value, 1)),
            year2 = last(year(date)),
            value2 = last(round(value, 1))) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

United Kingdom, United States, Ireland

Code
GFSMAB %>%
  left_join(iso2c, by = "iso2c") %>%
  filter(INDICATOR == "G24__Z",
         UNIT == "XDC_R_B1GQ",
         iso2c %in% c("GB", "IE", "US"),
         SECTOR == "S1321") %>%
  mutate(value = value/100) %>%
  left_join(colors, by = c("Iso2c" = "country")) %>%
  ggplot(.) + geom_line() + theme_minimal() + scale_color_identity() + add_flags +
  aes(x = date, y = value, color = color) + 
  xlab("") + ylab("Interest Payments (% of GDP)") +
  theme(legend.title = element_blank(),
        legend.position = c(0.85, 0.85)) +
  scale_x_date(breaks = seq(1900, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
                     labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed", color = "grey")

Austria, Australia, Cyprus

Code
GFSMAB %>%
  left_join(iso2c, by = "iso2c") %>%
  filter(INDICATOR == "G24__Z",
         UNIT == "XDC_R_B1GQ",
         iso2c %in% c("AT", "AU", "CY"),
         SECTOR == "S1321") %>%
  mutate(value = value/100) %>%
  left_join(colors, by = c("Iso2c" = "country")) %>%
  ggplot(.) + geom_line() + theme_minimal() + scale_color_identity() + add_flags +
  aes(x = date, y = value, color = color) + 
  xlab("") + ylab("Interest Payments (% of GDP)") +
  theme(legend.title = element_blank(),
        legend.position = c(0.15, 0.85)) +
  scale_x_date(breaks = seq(1900, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
                     labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed", color = "grey")

Germany, France, Italy

Code
GFSMAB %>%
  left_join(iso2c, by = "iso2c") %>%
  filter(INDICATOR == "G24__Z",
         UNIT == "XDC_R_B1GQ",
         iso2c %in% c("DE", "FR", "IT"),
         SECTOR == "S1321") %>%
  mutate(value = value/100) %>%
  left_join(colors, by = c("Iso2c" = "country")) %>%
  ggplot(.) + geom_line() + theme_minimal() + scale_color_identity() + add_flags +
  aes(x = date, y = value, color = color) + 
  xlab("") + ylab("Interest Payments (% of GDP)") +
  theme(legend.title = element_blank(),
        legend.position = c(0.15, 0.85)) +
  scale_x_date(breaks = seq(1900, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
                     labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed", color = "grey")