This essay takes a brief look at inflation before and after January 2020, which may be considered the beginning of the Covid-19 pandemic, for the countries that are members of the Organization for Economic Cooperation and Development (OECD). Specifically, my goal is to check whether the sharp rise in inflation in the United States at the end of 2021 could be considered unusual. The OECD countries are all richer than average and, therefore, somewhat comparable to the United States.

My essay shows four charts and a table. I have shown the R code, so that others – including future me! – may find it useful.

Getting the data

There are many ways to get the list of OECD countries. I went to the World Population Review, scrolled down to the bottom of the page and downloaded the file named csvData.csv by clicking on the icon for CSV download. I stored the file in my working directory; this can be specified to R by using the setwd([Insert your working directory]) command. Once the file is saved, the following command prepares the list of countries.

OECD <- read.csv("csvData.csv")$ï..country
OECD
##  [1] "United States"  "Mexico"         "Japan"          "Turkey"        
##  [5] "Germany"        "United Kingdom" "France"         "Italy"         
##  [9] "South Korea"    "Spain"          "Canada"         "Poland"        
## [13] "Australia"      "Chile"          "Netherlands"    "Belgium"       
## [17] "Czech Republic" "Greece"         "Sweden"         "Portugal"      
## [21] "Hungary"        "Austria"        "Israel"         "Switzerland"   
## [25] "Denmark"        "Finland"        "Norway"         "Slovakia"      
## [29] "Ireland"        "New Zealand"    "Lithuania"      "Slovenia"      
## [33] "Latvia"         "Estonia"        "Luxembourg"     "Iceland"

My data on inflation comes from the World Bank. I scrolled down to the Data Download section and saved the hyperlinked Excel file Inflation-data.xlsx to my working directory. Once the file is saved, the data in it can be imported into R and readied for chart making.

Note that there are 36 OECD countries. Unfortunately, the World Bank’s spreadsheet does not have data for New Zealand for some reason.

library(tidyverse)
library(readxl)

alldata <- read_xlsx(
  path = "Inflation-data.xlsx",
  sheet = "hcpi_m",
  col_names = TRUE
) %>%
  select(-any_of(c("Country Code", "IMF Country Code", "Indicator Type", "Series Name"))) %>%
  pivot_longer(cols = !1, names_to = "date", values_to = "CPI") %>%
  mutate(date = as.Date(as.character(as.numeric(date)*100 + 1), "%Y%m%d")) %>%
  mutate(inflation.yoy = 100*(CPI - lag(CPI, 12))/lag(CPI, 12)) %>%
  filter (Country %in% OECD, date >= '2018-01-01') %>%
  na.omit()

The Inflation-data.xlsx file has numerous sheets, each with cross-country data for a different measure of the overall level of prices. In the code chunk above I import monthly data on the headline consumer price index from the hcpi_m sheet. I then calculate inflation.yoy, the year-on-year inflation rate, for all countries and all months. Finally, I throw away the data for non-OECD countries and the months before January 2018, as I won’t be needing them for my analysis.

Chart 1: Recent inflation in OECD countries

pan.start <- as.Date("2020-01-01")
ggplot(alldata, aes(x = date, y = inflation.yoy)) +
  geom_line(aes(group = Country)) +
  ylim(-3, 20) +
  labs (x = NULL, y = NULL, title = "Inflation (% increase in CPI from a year earlier), Jan 2018 to Feb 2022, \nOECD Countries, Pandemic Starts at Jan 2020") +
  geom_vline(aes(xintercept = pan.start), linetype = "dashed") +
  scale_x_continuous(breaks = pan.start, labels = "Jan 2020") +
  theme_bw() +
  facet_wrap(~Country)

Note that inflation is higher in February 2022, which is the most recent month in our data set, than in any month in the previous four years for most, if not all, countries. (More on this below.)

Measuring inflation before and after the pandemic

Next, I need to measure inflation rates before and after the start of the pandemic in January 2020. Here, before the pandemic means the years 2018 and 2019, and after the pandemic is the period from January 2020 till February 2022.

OECD2 <- alldata %>%
  group_by(Country) %>%
  summarise(
            pandemic = mean(inflation.yoy[date >= '2020-01-01']) - mean(inflation.yoy[date < '2020-01-01']),
            pandemic2 = 100*
              (mean(inflation.yoy[date >= '2020-01-01']) - mean(inflation.yoy[date < '2020-01-01']))/mean(inflation.yoy[date < '2020-01-01']),
            CPI.jump = 100*
              (CPI[date == max(date)] -
              ((CPI[date == '2019-12-01'] + CPI[date == '2019-11-01'] + 
              CPI[date == '2019-10-01'])/3))/((CPI[date == '2019-12-01'] + 
              CPI[date == '2019-11-01'] + CPI[date == '2019-10-01'])/3),
            inflation.peak = date[inflation.yoy == max(inflation.yoy)]
            ) %>%
  na.omit()

In the preceding code chunk, I use the CPI data and the year-on-year inflation numbers that I had calculated earlier to calculate three numbers:

  1. CPI.jump: the percentage by which CPI in February 2022, the last month for which this data set has data, exceeds the average CPI for the last three months before the pandemic (that is, October, November, and December of 2019). This is, therefore, a measure of post-pandemic inflation. It is not a comparison of post-pandemic and pre-pandemic inflation.
  2. pandemic: The number of percentage points by which the average year-on-year inflation in the post-pandemic months exceeds the average year-on-year inflation in the pre-pandemic months. This certainly provides a comparison of post-pandemic and pre-pandemic inflation.
  3. pandemic2: The percentage by which the average year-on-year inflation in the post-pandemic months exceeds the average year-on-year inflation in the pre-pandemic months. This too provides a comparison of post-pandemic and pre-pandemic inflation. This is my preferred measure.

Inflation peaks

To highlight the recent upturn in inflation in much of the world, let us look at peak inflation since January 2018.

OECD2 %>% 
  select(Country, inflation.peak) %>% 
  knitr::kable(caption = "Month with highest inflation, Jan 2018 -- Feb 2022") %>%
  kableExtra::kable_styling(full_width = FALSE)
Month with highest inflation, Jan 2018 – Feb 2022
Country inflation.peak
Austria 2022-02-01
Belgium 2022-02-01
Canada 2022-02-01
Chile 2022-02-01
Czech Republic 2022-02-01
Denmark 2022-02-01
Estonia 2021-12-01
Finland 2022-02-01
France 2022-02-01
Germany 2021-12-01
Greece 2022-02-01
Hungary 2022-02-01
Iceland 2022-02-01
Ireland 2022-02-01
Israel 2022-02-01
Italy 2022-02-01
Japan 2018-02-01
Latvia 2022-02-01
Lithuania 2022-02-01
Luxembourg 2022-02-01
Mexico 2021-11-01
Netherlands 2022-01-01
Norway 2021-12-01
Poland 2022-01-01
Portugal 2022-02-01
Slovakia 2022-02-01
Slovenia 2022-02-01
Spain 2022-02-01
Sweden 2022-02-01
Switzerland 2022-02-01
Turkey 2022-02-01
United Kingdom 2022-02-01
United States 2022-02-01

So, inflation reached a four-year peak in most countries in February 2022, currently the last month in the World Bank’s Global Database of Inflation. Poland reached its inflation peak in January 2022; Estonia, Germany, and Norway reached their inflation peaks in December 2021; and Mexico reached its inflation peak in November 2021. Japan is the only country that saw inflation fall after January 2018.

This supports the idea that inflation has been on the rise everywhere in recent months.

Chart 2: Post-Pandemic Rise in Prices

OECD2$Country <- 
  factor(OECD2$Country, levels = 
           OECD2$Country[order(OECD2$CPI.jump)])
ggplot(OECD2, aes(x = CPI.jump, y = Country)) +
  geom_segment(aes(yend = Country), xend = 0, colour = "grey50") +
  geom_point(size = 3, aes(colour = ifelse(CPI.jump > 0,"red", "blue"))) +
  labs (title = "How much higher was the CPI in Feb 2022 compared to the \naverage CPI in October, November, and December of 2019?") +
  theme_bw() +
  theme(legend.position="none") +
  labs(x = "Post-pandemic inflation (%)",
       y = NULL)

Note that the Consumer Price Index (CPI) in the United States in February 2022 is 10.32 percent higher than the average CPI in the last three months before the pandemic (October – December 2019). This certainly shows a big increase in prices after the pandemic began and it puts America clearly in the high-inflation group of OECD countries.

Unfortunately, this number doesn’t tell us whether post-pandemic inflation is any different from pre-pandemic inflation.

Chart 3: Rise in inflation, pre-pandemic to post-pandemic

OECD2$Country <- 
  factor(OECD2$Country, levels = 
           OECD2$Country[order(OECD2$pandemic)])
ggplot(OECD2, aes(x = pandemic, y = Country)) +
  geom_segment(aes(yend = Country), xend = 0, colour = "grey50") +
  geom_point(size = 3, aes(colour = ifelse(pandemic > 0,"red", "blue"))) +
  theme_bw() +
  theme(legend.position="none") +
  labs(x = "Post-pandemic increase in inflation (percentage points)",
       y = NULL, title = "Increase in Average Inflation from Jan 2018 -- December 2019 to \nJan 2020 -- Feb 2022, percentage points")

Note that most countries had higher inflation post-pandemic than pre-pandemic. Only 7 of the 35 countries in the chart had lower inflation post-pandemic. (There are 36 OECD countries, but there is no data on New Zealand in the data set I have used.) So, the higher post-pandemic inflation in the United States is definitely not exceptional.

Six countries had a larger increase in inflation than the United States.

Chart 4: Rise in inflation, pre-pandemic to post-pandemic, Part 2

OECD2$Country <- 
  factor(OECD2$Country, levels = 
           OECD2$Country[order(OECD2$pandemic2)])
ggplot(OECD2, aes(x = pandemic2, y = Country)) +
  geom_segment(aes(yend = Country), xend = 0, colour = "grey50") +
  geom_point(size = 3, aes(colour = ifelse(pandemic2 > 0,"red", "blue"))) +
  theme_bw() +
  theme(legend.position="none") +
  labs(x = "Post-pandemic increase in inflation (%)",
       y = NULL, title = "Increase in Average Inflation from Jan 2018 -- December 2019 \nto Jan 2020 -- Feb 2022, %")

Charts 3 and 4 have a very similar message: Most countries had higher inflation after the start of the pandemic than before. Only 7 of the 35 countries saw less inflation after the pandemic than before. So, once again, it is safe to say that the post-pandemic jump in inflation in the United States is definitely not unusual.

The United States is sixth from to the top in Chart 4.

The case of Turkey is interesting. It had extremely high inflation in the post-pandemic period and is clearly an outlier in Chart 2. But Turkey’s inflation was very high even before the pandemic. This is why the percentage difference between Turkey’s post- and pre-pandemic inflation rates is not especially high (Chart 4). However, because both Turkey’s pre- and post-pandemic inflation rates are both so unusually high, Turkey’s post-pandemic inflation can be much higher than its pre-pandemic inflation when the difference is measured in percentage points rather than in percent (Chart 3).

Conclusion

No OECD country saw a decrease in the CPI (negative inflation) between January 2020, the start of the pandemic, and February 2022. And 10 of the 35 OECD countries saw larger increases in CPI than the United States did.

Only 7 of the 35 OECD countries saw lower inflation rates after the pandemic. This suggests that increases in inflation after the pandemic is the norm rather than the exception. Five countries saw increases in inflation after the start of the pandemic that were larger than the increase seen in the United States.

There’s nothing here that suggests that the pandemic caused the inflation spikes we see. More extensive analysis would be needed to measure the effect of the pandemic on inflation rates, if any.

The End