Cyclically adjusted primary balance (% of potential GDP)

Data - IMF - FM

Info

LAST_DOWNLOAD

source dataset Title Download Compile
eurostat ei_mfir_m Interest rates - monthly data 2024-11-16 [2024-11-16]
eurostat gov_10q_ggdebt Quarterly government debt 2024-11-16 [2024-11-16]
fred r Interest Rates 2024-11-09 [2024-11-09]
fred saving Saving - saving 2024-11-16 [2024-11-16]
gfd debt Debt 2021-03-01 [2021-08-22]
imf FM Fiscal Monitor 2020-03-13 [2024-06-20]
imf GGXCNL_G01_GDP_PT Net lending/borrowing (also referred as overall balance) (% of GDP) 2024-11-17 [2024-11-17]
imf GGXONLB_G01_GDP_PT Primary net lending/borrowing (also referred as primary balance) (% of GDP) 2024-11-17 [2024-11-17]
imf GGXWDN_G01_GDP_PT Net debt (% of GDP) 2024-05-06 [2024-10-29]
imf HPDD Historical Public Debt Database NA [2024-06-20]
oecd QASA_TABLE7PSD Quarterly Sector Accounts - Public Sector Debt, consolidated, nominal value 2024-11-16 [2024-09-15]
wdi GC.DOD.TOTL.GD.ZS Central government debt, total (% of GDP) 2024-09-18 [2023-06-18]
wdi GC.XPN.INTP.CN Interest payments (current LCU) 2024-09-18 [2023-06-18]
wdi GC.XPN.INTP.RV.ZS Interest payments (% of revenue) 2024-09-18 [2023-06-18]
wdi GC.XPN.INTP.ZS Interest payments (% of expense) 2024-09-18 [2024-09-18]

LAST_COMPILE

LAST_COMPILE
2024-11-17

Last

TIME_PERIOD FREQ Nobs
2029 A 96

FREQ

Code
GGCBP_G01_PGDP_PT %>%
  left_join(FREQ, by =  "FREQ") %>%
  group_by(FREQ, Freq) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
FREQ Freq Nobs
A Annual 3141

REF_AREA

Code
GGCBP_G01_PGDP_PT %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         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 .}

TIME_PERIOD

Code
GGCBP_G01_PGDP_PT %>%
  group_by(TIME_PERIOD) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(TIME_PERIOD)) %>%
  print_table_conditional()

Table

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         TIME_PERIOD == "2018") %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  select(REF_AREA, Ref_area, OBS_VALUE) %>%
  arrange(-OBS_VALUE) %>%
  na.omit %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 1), " %"))) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         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, France, Germany, United States

1990-

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA %in% c("IT", "FR", "DE", "US", "GR", "ES")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  year_to_date2 %>%
  filter(date <= as.Date("2019-01-01")) %>%
  rename(Counterpart_area = Ref_area) %>%
  left_join(colors, by = c("Counterpart_area" = "country")) %>%
  mutate(OBS_VALUE = OBS_VALUE/100,
         color = ifelse(REF_AREA == "US", color2, color)) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-60, 60, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Cyclically adj. primary balance (% of potential GDP)") + xlab("") +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black")

2005-

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA %in% c("IT", "FR", "DE", "US", "", "ES", "U2")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  year_to_date2 %>%
  filter(date <= as.Date("2017-01-01"),
         date >= as.Date("2006-01-01")) %>%
  mutate(Ref_area = ifelse(REF_AREA == "U2", "Europe", Ref_area)) %>%
  rename(Counterpart_area = Ref_area) %>%
  left_join(colors, by = c("Counterpart_area" = "country")) %>%
  mutate(OBS_VALUE = OBS_VALUE/100,
         color = ifelse(REF_AREA == "US", color2, color)) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-60, 60, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Cyclically adj. primary balance (% of potential GDP)") + xlab("") +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black")

2017-

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA %in% c("IT", "FR", "DE", "US", "", "ES", "U2")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  year_to_date2 %>%
  filter(date >= as.Date("2017-01-01")) %>%
  mutate(Ref_area = ifelse(REF_AREA == "U2", "Europe", Ref_area)) %>%
  rename(Counterpart_area = Ref_area) %>%
  left_join(colors, by = c("Counterpart_area" = "country")) %>%
  mutate(OBS_VALUE = OBS_VALUE/100,
         color = ifelse(REF_AREA == "US", color2, color)) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-60, 60, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Cyclically adj. primary balance (% of potential GDP)") + xlab("") +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black")

Italy, France, Germany, United States

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA %in% c("IT", "FR", "DE", "US")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  year_to_date2 %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area, linetype = Ref_area)) +
  scale_color_manual(values = viridis(5)[1:4]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.6, 0.9),
        legend.title = element_blank(),
        legend.direction = "horizontal") +
  scale_y_continuous(breaks = 0.01*seq(-60, 60, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Cyclically adj. primary balance (% of potential GDP)") + xlab("") +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black")

Individual Countries

Italy

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA == "IT") %>%
  select(INDICATOR, TIME_PERIOD, OBS_VALUE) %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 1), " %"))) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Netherlands

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA == "NL") %>%
  select(INDICATOR, TIME_PERIOD, OBS_VALUE) %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 1), " %"))) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Average Primary Surpluses

6 Countries

Code
GGCBP_G01_PGDP_PT %>%
  filter(INDICATOR == "GGCBP_G01_PGDP_PT",
         REF_AREA %in% c("NL", "IT", "DE", "FR", "ES", "GR")) %>%
  year_to_date2 %>%
  filter(date >= as.Date("1995-01-01")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(Ref_area) %>%
  summarise(`Primary Surplus (1995-2020)` = mean(OBS_VALUE)) %>%
  mutate_at(vars(2), funs(paste0(round(as.numeric(.), 3), " %"))) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All Countries

Code
GGCBP_G01_PGDP_PT %>%
  year_to_date2 %>%
  filter(date >= as.Date("1995-01-01"),
         date <= as.Date("2019-01-01")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area) %>%
  summarise(`Average Primary Surplus (1995-2019)` = mean(OBS_VALUE)) %>%
  arrange(-`Average Primary Surplus (1995-2019)`) %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 3), " %"))) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         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 .}

Code

Code
i_g("bib/imf/FM-data.jpeg")

Average Primary Surpluses

1995-2019

Code
GGCBP_G01_PGDP_PT %>%
  year_to_date2 %>%
  filter(date >= as.Date("1995-01-01"),
         date <= as.Date("2019-01-01")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area) %>%
  summarise(`Average Primary Surplus (1995-2019)` = mean(OBS_VALUE)) %>%
  arrange(-`Average Primary Surplus (1995-2019)`) %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 3), " %"))) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         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 .}

1990-2019

Code
GGCBP_G01_PGDP_PT %>%
  year_to_date2 %>%
  filter(date >= as.Date("1990-01-01"),
         date <= as.Date("2019-01-01")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area) %>%
  summarise(`Average Primary Surplus (1990-2019)` = mean(OBS_VALUE)) %>%
  arrange(-`Average Primary Surplus (1990-2019)`) %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 3), " %"))) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         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 .}

Average Primary Surpluses (1995-2019) - Underlying Data

1992-

Code
GGCBP_G01_PGDP_PT %>%
  year_to_date2() %>%
  filter(date >= as.Date("1992-01-01")) %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area) %>%
  summarise(`Primary Surplus (1992-2020)` = mean(OBS_VALUE)) %>%
  arrange(-`Primary Surplus (1992-2020)`) %>%
  mutate_at(vars(3), funs(paste0(round(as.numeric(.), 3), " %"))) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         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 .}

1992-

Code
GGCBP_G01_PGDP_PT %>%
  year_to_date2 %>%
  filter(date >= as.Date("1992-01-01")) %>%
  group_by(iso2c = REF_AREA) %>%
  summarise(OBS_VALUE = mean(OBS_VALUE)) %>%
  right_join(world, by = "iso2c") %>%
  ggplot() + theme_void() +
  geom_polygon(aes(long, lat, group = group, fill = OBS_VALUE/100), 
               colour = alpha("black", 1/2), size = 0.1)  +
  scale_fill_viridis_c(name = "Primary Surplus (%)",
                       labels = scales::percent_format(accuracy = 1),
                       breaks = seq(-0.10, 0.2, 0.01),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1)) +
  theme(legend.position = c(0.1, 0.4),
        legend.title = element_text(size = 10))

1995-2019

Code
GGCBP_G01_PGDP_PT %>%
  year_to_date2 %>%
  filter(date >= as.Date("1995-01-01"),
         date <= as.Date("2019-01-01")) %>%
  group_by(iso2c = REF_AREA) %>%
  summarise(OBS_VALUE = mean(OBS_VALUE)) %>%
  right_join(world, by = "iso2c") %>%
  ggplot() + theme_void() +
  geom_polygon(aes(long, lat, group = group, fill = OBS_VALUE/100), 
               colour = alpha("black", 1/2), size = 0.1)  +
  scale_fill_viridis_c(name = "Primary Surplus",
                       labels = scales::percent_format(accuracy = 1),
                       breaks = seq(-0.10, 0.2, 0.01),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1)) +
  theme(legend.position = c(0.12, 0.4),
        legend.title = element_text(size = 10))