Macroeconomics: Evidence, Theory, and Policy

Part 1

(1.1) Imitation of the Economist’s Graph

The graph below is a replication of one found in an article of the Economist showing nominal GDP for Germany, France, the UK, the US, Italy, and Spain, indexed at Q4 2019 until Q3 2021.

library("OECD")
library("WDI")
library("fredr")
library("rdbnomics")
## Visit <https://db.nomics.world>.
library("tidyverse")
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.1     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
data1 <- rdb(ids = c("OECD/QNA/FRA.B1_GS1.CQRSA.Q",
           "OECD/QNA/DEU.B1_GS1.CQRSA.Q",
           "OECD/QNA/ITA.B1_GS1.CQRSA.Q",
           "OECD/QNA/USA.B1_GS1.CQRSA.Q",
           "OECD/QNA/GBR.B1_GS1.CQRSA.Q",
           "OECD/QNA/ESP.B1_GS1.CQRSA.Q")) %>%
  select(period, Country, value)

data1_filtered <- data1 %>% 
  filter(period >= as.Date("2019-10-01") & period <= as.Date("2021-09-30")) %>%
  group_by(Country) %>%
  mutate(value_indexed = value / value[period == as.Date("2019-10-01")] * 100)

ggplot(data1_filtered, aes(x = period, y = value_indexed, color = Country)) +
  geom_line() +
  labs(title = "Copied Graph: Why So Blue? GDP, Q4 2019=100", x = "Time", y = "Indexed GDP")

(1.2) Replicated Using Real GDP

The following graph shows real GDP for Germany, France, the UK, the US, Italy, and Spain, indexed at Q4 2019 until Q3 2021.

data2 <- rdb(ids = c("OECD/QNA/FRA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/DEU.B1_GE.VOBARSA.Q",
                     "OECD/QNA/ITA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/USA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/GBR.B1_GE.VOBARSA.Q",
                     "OECD/QNA/ESP.B1_GE.VOBARSA.Q")) %>%
  select(period, Country, value)

data2_filtered <- data2 %>% 
  filter(period >= as.Date("2019-10-01") & period <= as.Date("2021-09-30")) %>%
  group_by(Country) %>%
  mutate(value_indexed = value / value[period == as.Date("2019-10-01")] * 100)

ggplot(data2_filtered, aes(x = period, y = value_indexed, color = Country)) +
  geom_line() +
  labs(title = "Real GDP: Q4 2019 = 100", x = "Time", y = "Real GDP")

(1.3) Real GDP Replication Extended to Include Current Data

Updated graph from 1.2 to include the latest macroeconomic data.

data3 <- rdb(ids = c("OECD/QNA/FRA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/DEU.B1_GE.VOBARSA.Q",
                     "OECD/QNA/ITA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/USA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/GBR.B1_GE.VOBARSA.Q",
                     "OECD/QNA/ESP.B1_GE.VOBARSA.Q")) %>%
  select(period, Country, value)

data3_filtered <- data3 %>% 
  filter(period >= as.Date("2019-10-01")) %>%
  group_by(Country) %>% 
    mutate(value_indexed = value / value[period == as.Date("2019-10-01")] * 100)

ggplot(data3_filtered, aes(x = period, y = value_indexed, color = Country)) +
  geom_line() +
  labs(title = "Real GDP: Q4 2019 - Current: Q4 2019 = 100", x = "Period", y = "Indexed GDP")

(1.4) France Ain’t Doing So Well After All

When analysing real GDP growth compared to the following economies, it seems France ain’t doing so well after all…

data4 <- rdb(ids = c("OECD/QNA/FRA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/NZL.B1_GE.VOBARSA.Q",
                     "OECD/QNA/POL.B1_GE.VOBARSA.Q",
                     "OECD/QNA/SWE.B1_GE.VOBARSA.Q",
                     "OECD/QNA/NLD.B1_GE.VOBARSA.Q",
                     "OECD/QNA/IRL.B1_GE.VOBARSA.Q")) %>%
  select(period, Country, value)

data4_filtered <- data4 %>% 
  filter(period >= as.Date("2019-10-01")) %>%
  group_by(Country) %>% 
  mutate(value_indexed = value / value[period == as.Date("2019-10-01")] * 100)

ggplot(data4_filtered, aes(x = period, y = value_indexed, color = Country)) +
  geom_line() +
  labs(title = "France Ain't Doing So Well After All; 5 Better Performers! Q4 2019 = 100", x = "Time", y = "Real GDP")

(1.5) France: Underperforming Others

Considering historical trends (indexed at Q1 2000), it seems France ain’t been doing so well for a while now in terms of real GDP…

data5 <- rdb(ids = c("OECD/QNA/FRA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/IRL.B1_GE.VOBARSA.Q",
                     "OECD/QNA/POL.B1_GE.VOBARSA.Q",
                     "OECD/QNA/SWE.B1_GE.VOBARSA.Q",
                     "OECD/QNA/NLD.B1_GE.VOBARSA.Q",
                     "OECD/QNA/NZL.B1_GE.VOBARSA.Q")) %>%
  select(period, Country, value)

data5_filtered <- data5 %>% 
  filter(period >= as.Date("2000-01-01")) %>%
  group_by(Country) %>% 
  mutate(value_indexed = value / value[period == as.Date("2000-01-01")] * 100)

ggplot(data5_filtered, aes(x = period, y = value_indexed, color = Country)) +
  geom_line() +
  labs(title = "France: Underperforming: Q1 2000 = 100", x = "Time", y = "Real GDP")

(1.6) A Comparison to Important Global Economies

When compared with important global economies, France’s real GDP has remained relatively constant with respect to economies such as India which have grown considerably during the same time period.

data6 <- rdb(ids = c("OECD/QNA/FRA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/USA.B1_GE.VOBARSA.Q",
                     "OECD/QNA/GBR.B1_GE.VOBARSA.Q",
                     "OECD/QNA/RUS.B1_GE.VOBARSA.Q",
                     "OECD/QNA/JPN.B1_GE.VOBARSA.Q",
                     "OECD/QNA/IND.B1_GE.VOBARSA.Q")) %>%
  select(period, Country, value)

data6_filtered <- data6 %>% 
  filter(period >= as.Date("2000-01-01")) %>%
  group_by(Country) %>% 
  mutate(value_indexed = value / value[period == as.Date("2000-01-01")] * 100)

ggplot(data6_filtered, aes(x = period, y = value_indexed, color = Country)) +
  geom_line() +
  labs(title = "France Compared to Strong Economies: Q1 2000 = 100", x = "Time", y = "Real GDP")

Analysis Using Different Variables

(1.7.a) A GDP per Capita Comparison

Taking GDP per capita as a measure of well-being since 1995, we find similar trends: France shows relatively modest incremental growth.

data7 <- rdb(ids = c("WB/WDI/A-NY.GDP.PCAP.KD-USA",
                     "WB/WDI/A-NY.GDP.PCAP.KD-FRA",
                     "WB/WDI/A-NY.GDP.PCAP.KD-GBR",
                     "WB/WDI/A-NY.GDP.PCAP.KD-RUS",
                     "WB/WDI/A-NY.GDP.PCAP.KD-JPN",
                     "WB/WDI/A-NY.GDP.PCAP.KD-IND")) %>%
  select(period, country, value)

data7_filtered <- data7 %>% 
  filter(period >= as.Date("1995-01-01")) %>%
  group_by(country) %>% 
  mutate(value_indexed = value / value[period == as.Date("1995-01-01")] * 100)

ggplot(data7_filtered, aes(x = period, y = value_indexed, color = country)) +
  geom_line() +
  labs(title = "GDP per Capita Comparison: Q1 1995 = 100", x = "Time", y = "GDP per Capita")

(1.7.b) A GDP, PPP Comparison

A PPP comparison, once again, shows similar trends to those above, with the exception of Russia.

data8 <- rdb(ids = c("WB/WDI/A-NY.GDP.MKTP.PP.KD-USA",
                     "WB/WDI/A-NY.GDP.MKTP.PP.KD-FRA",
                     "WB/WDI/A-NY.GDP.MKTP.PP.KD-GBR",
                     "WB/WDI/A-NY.GDP.MKTP.PP.KD-RUS",
                     "WB/WDI/A-NY.GDP.MKTP.PP.KD-JPN",
                     "WB/WDI/A-NY.GDP.MKTP.PP.KD-IND")) %>%
  select(period, country, value)

data8_filtered <- data8 %>% 
  filter(period >= as.Date("1995-01-01")) %>%
  group_by(country) %>% 
  mutate(value_indexed = value / value[period == as.Date("1995-01-01")] * 100)

ggplot(data8_filtered, aes(x = period, y = value_indexed, color = country)) +
  geom_line() +
  labs(title = "GDP, PPP: Q1 1995 = 100", x = "Time", y = "GDP, PPP")

(1.7.c) A Final Consumption Expenditure Comparison

The same holds for the following comparison of Final Consumption Expenditure.

data9 <- rdb(ids = c("WB/WDI/A-NE.CON.TOTL.KD-USA",
                     "WB/WDI/A-NE.CON.TOTL.KD-FRA",
                     "WB/WDI/A-NE.CON.TOTL.KD-GBR",
                     "WB/WDI/A-NE.CON.TOTL.KD-RUS",
                     "WB/WDI/A-NE.CON.TOTL.KD-JPN",
                     "WB/WDI/A-NE.CON.TOTL.KD-IND")) %>%
  select(period, country, value)

data9_filtered <- data9 %>% 
  filter(period >= as.Date("1995-01-01")) %>%
  group_by(country) %>% 
  mutate(value_indexed = value / value[period == as.Date("1995-01-01")] * 100)

ggplot(data9_filtered, aes(x = period, y = value_indexed, color = country)) +
  geom_line() +
  labs(title = "Final Consumption Expenditure Comparison: Q1 1995 = 100", x = "Time", y = "Final Consumption Expenditure")

Part 2

(2.1) Replicated ‘Eurozone: Total Employment’ graph; Q4 2019 = 100

library ("eurostat")
library("tidyverse")

namq_10_a10_e <- get_eurostat("namq_10_a10_e")
## Reading cache file /var/folders/j7/rk13qj3x04n3bx_trcnrfctw0000gn/T//Rtmp7y8F77/eurostat/namq_10_a10_e_date_code_FF.rds
## Table  namq_10_a10_e  read from cache file:  /var/folders/j7/rk13qj3x04n3bx_trcnrfctw0000gn/T//Rtmp7y8F77/eurostat/namq_10_a10_e_date_code_FF.rds
EMP_index <- namq_10_a10_e %>%
    filter(na_item == "EMP_DC", nace_r2 == "TOTAL", geo %in% c("DE", "FR", "IT", "ES","EA"),
             unit == "THS_PER",
             s_adj == "SCA",
             time >= as.Date("2000-01-01")) %>%
      group_by(geo) %>%
      mutate(EMP_index = values / values[time == as.Date("2019-10-01")] * 100)

EMPindex_France_SA <- namq_10_a10_e %>%
    filter(na_item == "EMP_DC", nace_r2 == "TOTAL", geo %in% c("FR"),
             unit == "THS_PER",
             s_adj == "SA",
             time >= as.Date("2000-01-01")) %>%
      group_by(geo) %>%
      mutate(EMPindex_France_SA = values / values[time == as.Date("2019-10-01")] * 100)

ggplot() + geom_line(data = EMP_index, aes(x = time, y = EMP_index, color = geo)) +
      geom_line(data = EMPindex_France_SA, aes(x = time, y = EMPindex_France_SA, color = "France (SA)")) + theme_minimal() + scale_x_date(date_breaks = "2 years") + labs(title = "Eurozone: Total Employment (Q4 2019 = 100)", x = "Year", y = "Index = Q4 2019") 

(2.2) Longer Historical Perspective on ‘Eurozone: Total Employment’ graph; Q4 2008 = 100

namq_10_a10_e <- get_eurostat("namq_10_a10_e")
## Reading cache file /var/folders/j7/rk13qj3x04n3bx_trcnrfctw0000gn/T//Rtmp7y8F77/eurostat/namq_10_a10_e_date_code_FF.rds
## Table  namq_10_a10_e  read from cache file:  /var/folders/j7/rk13qj3x04n3bx_trcnrfctw0000gn/T//Rtmp7y8F77/eurostat/namq_10_a10_e_date_code_FF.rds
Index96<- namq_10_a10_e %>% 
  filter(na_item == "EMP_DC", nace_r2 == "TOTAL", geo %in% c("DE", "FR", "IT", "ES","EA"), unit == "THS_PER", s_adj == "SCA", time >= as.Date("1996-01-01")) %>% group_by(geo) %>% mutate(Index96 = values / values[time == as.Date("2008-10-01")]* 100)

EMPindex_France_SA <- namq_10_a10_e %>%   
  filter(na_item == "EMP_DC", nace_r2 == "TOTAL", geo %in% c("FR"), unit == "THS_PER", s_adj == "SA", time >= as.Date("1996-01-01")) %>% group_by(geo) %>% mutate(EMPindex_France_SA = values / values[time == as.Date("2008-10-01")]* 100)

ggplot() + geom_line(data = Index96, aes(x = time, y = Index96, color = geo)) + geom_line(data = EMPindex_France_SA, aes(x = time, y = EMPindex_France_SA, color = "France (SA)")) + theme_minimal() + scale_x_date(date_breaks = "2 years") + labs(title = "Eurozone: Total Employment (Q4 2008 = 100)", x = "Year", y = "Index = Q4 2019")

(2.3) Analysis by types of Employment and Sector

(2.3.a) Self-Employed, Industry (No Construction)

Across the Eurozone, there has been a general decline of self-employed workers in the ‘Industry’ sector, with the notable exception of France, which has grown since 2010.

Industry_1 <- namq_10_a10_e %>%
  filter(na_item %in% c("SELF_DC"),
         nace_r2 == "B-E",
         s_adj %in% c("SCA", "SA"),
         geo %in% c("DE", "FR", "IT", "ES", "EA"),
         unit == "THS_PER",
         time >= as.Date("1996-01-01")) %>%
  group_by(geo) %>%
  mutate(IndustryIndex1 = values / values[time == as.Date("2008-10-01")] * 100)

ggplot(Industry_1, aes(x = time, y = IndustryIndex1, color = geo)) +
  geom_line() +
  labs(title = "Self Employed - Industry (no construction): Q4 2008 = 100", x = "Time", y = "# of Self-Employed")

(2.3.b) Employees, Industry (No Construction)

While some of the following Eurozone economies have witnessed a marked decrease in employed ‘Industry’ workers, notably Spain, others, including Germany, have witnessed an increase since 2008.

Industry_2 <- namq_10_a10_e %>%
  filter(na_item %in% c("SAL_DC"),
         nace_r2 == "B-E",
         s_adj %in% c("SCA", "SA"),
         geo %in% c("DE", "FR", "IT", "ES", "EA"),
         unit == "THS_PER",
         time >= as.Date("1996-01-01")) %>%
  group_by(geo) %>%
  mutate(IndustryIndex2 = values / values[time == as.Date("2008-10-01")] * 100)

ggplot(Industry_2, aes(x = time, y = IndustryIndex2, color = geo)) +
  geom_line() +
  labs(title = "Employee - Industry (no construction): Q4 2008 = 100", x = "Time", y = "# of Employees")

(2.3.c) Self-Employed, Wholesale and retail trade…

Across the Eurozone, there has been a general decline of self-employed workers in the ‘Wholesale and retail trade’ sector, especially in Germany. France is a notable exception in this sector, growing since 2008 albeit some fluctuations.

Industry_3 <- namq_10_a10_e %>%
  filter(na_item %in% c("SELF_DC"),
         nace_r2 == "G-I",
         s_adj %in% c("SCA", "SA"),
         geo %in% c("DE", "FR", "IT", "ES", "EA"),
         unit == "THS_PER",
         time >= as.Date("1996-01-01")) %>%
  group_by(geo) %>%
  mutate(IndustryIndex3 = values / values[time == as.Date("2008-10-01")] * 100)

ggplot(Industry_3, aes(x = time, y = IndustryIndex3, color = geo)) +
  geom_line() +
  labs(title = "Self Employed - Wholesale and retail trade: Q4 2008 = 100", x = "Time", y = "# of Self-Employed")

(2.3.d) Employees, Wholesale and retail trade…

Across the Eurozone, there has been a general increase in employed ‘Wholesale and retail trade’ workers. Spain grew significantly before the 2000s, but experienced a marked decline around 2008 in this sector. All economies experienced a modest decline in 2020.

Industry_4 <- namq_10_a10_e %>%
  filter(na_item %in% c("SAL_DC"),
         nace_r2 == "G-I",
         s_adj %in% c("SCA", "SA"),
         geo %in% c("DE", "FR", "IT", "ES", "EA"),
         unit == "THS_PER",
         time >= as.Date("1996-01-01")) %>%
  group_by(geo) %>%
  mutate(IndustryIndex4 = values / values[time == as.Date("2008-10-01")] * 100)

ggplot(Industry_4, aes(x = time, y = IndustryIndex4, color = geo)) +
  geom_line() +
  labs(title = "Employee - Wholesale and retail trade: Q4 2008 = 100", x = "Time", y = "# of Employees")

(2.3.e) Self-Employed, Agriculture

The following Eurozone economies experienced a relatively consistent decline in self-employed workers in the “Agriculture” sector.

Industry_5 <- namq_10_a10_e %>%
  filter(na_item %in% c("SELF_DC"),
         nace_r2 == "A",
         s_adj %in% c("SCA", "SA"),
         geo %in% c("DE", "FR", "IT", "ES", "EA"),
         unit == "THS_PER",
         time >= as.Date("1996-01-01")) %>%
  group_by(geo) %>%
  mutate(IndustryIndex5 = values / values[time == as.Date("2008-10-01")] * 100)

ggplot(Industry_5, aes(x = time, y = IndustryIndex5, color = geo)) +
  geom_line() +
  labs(title = "Self-Employed - Agriculture: Q4 2008 = 100", x = "Time", y = "# of Self-Employed")

(2.3.f) Employee, Agriculture

France’s number of employees in the ‘Agriculture’ sector generally decreased from the 2000s until 2010, increasing since then. Other Eurozone economies have experienced relative growth.

Industry_6 <- namq_10_a10_e %>%
  filter(na_item %in% c("SAL_DC"),
         nace_r2 == "A",
         s_adj %in% c("SCA", "SA"),
         geo %in% c("DE", "FR", "IT", "ES", "EA"),
         unit == "THS_PER",
         time >= as.Date("1996-01-01")) %>%
  group_by(geo) %>%
  mutate(IndustryIndex6 = values / values[time == as.Date("2008-10-01")] * 100)

ggplot(Industry_6, aes(x = time, y = IndustryIndex6, color = geo)) +
  geom_line() +
  labs(title = "Employee - Agriculture: Q4 2008 = 100", x = "Time", y = "# of Employees")

(2.4) ‘Eurozone: Total Unemployment’

When compared to the ‘Eurozone: Total Employment’ graph replicated in 2.1, the ‘Eurozone: Total Unemployment’ shows that Germany has experienced a very pronounced decline in unemployment since 2008. This difference is more modest in the former.

une_rt_q <- get_eurostat("une_rt_q")
## Reading cache file /var/folders/j7/rk13qj3x04n3bx_trcnrfctw0000gn/T//Rtmp7y8F77/eurostat/une_rt_q_date_code_FF.rds
## Table  une_rt_q  read from cache file:  /var/folders/j7/rk13qj3x04n3bx_trcnrfctw0000gn/T//Rtmp7y8F77/eurostat/une_rt_q_date_code_FF.rds
UnemploymentIndex <- une_rt_q %>% 
  filter(unit == "THS_PER", age == "Y15-74", geo %in% c("DE", "FR", "IT", "ES","EA"), s_adj == "SA", sex == "T", time >= as.Date("2000-01-01")) %>% group_by(geo) %>% 
mutate(UnemploymentIndex = values / values[time == as.Date("2019-10-01")] * 100)

ggplot(UnemploymentIndex, aes(x = time, y = UnemploymentIndex, color = geo)) + geom_line() + labs(title = "Eurozone: Total Unemployment", x = "Time", y = "Unemployment Q4 2019 =100")