DATA 608 Story 2

## Does the US Federal Reserve Bank Fulfill its Mandate?

In Keynes’ economics and in fiscal policy, a countries’ central bank is responsible for controlling the funds rate, which in turn has influence on the unemployment rate and the inflation rate. Therefore, using this tool, the US Federal Reserve (short: FED), aims to control both at the same time. However, given economic principles, it appears to be difficult to do both at the same time, as inflation is intrically linked with unemployment. During times of economic boom, inflation may rise, coupled with low unemployment; during economic hardships, the inverse is true. Therefore, it is necessary to ask: does the FED actually maintain this goal?

To answer this question, data from the last 25 years for the FED funds rate, unemployment rate, and inflation rate, was extracted from the FED’s database, FRED, and from the Beaureau of Labor Statistics, respectively.

Below, the API for both is used to extract said data, and subsequently visualizations were created in Excel to showcase whether this goal was reached.

#----Call packages----
library(rjson)
Warning: package 'rjson' was built under R version 4.3.3
library(blsAPI)
library(httr)
Warning: package 'httr' was built under R version 4.3.2
library(dplyr)
Warning: package 'dplyr' was built under R version 4.3.2

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
#----BLS----
#Function to interact quickly with BLS API
bsl_payload = function(seriesid, startyear, endyear, nrow) {
  payload <- list(
    'seriesid'  = c(seriesid),
    'startyear' = startyear,
    'endyear'   = endyear)
  response <- blsAPI(payload, 2)
  json     <- fromJSON(response)
  df  <- data.frame(matrix(unlist(json$Results$series[[1]]$data), 
                           nrow = length(json$Results$series[[1]]$data), byrow = TRUE))
  colnames(df) <- c("year", "period", "periodName", "value")
  return(df)
} 

cpi_1999_2008 = bsl_payload('CUUR0000SA0', 1999, 2008) #Can only pull 10 years at a time it appears
cpi_2009_2018 = bsl_payload('CUUR0000SA0', 2009, 2018)
cpi_2018_2023 = bsl_payload('CUUR0000SA0', 2018, 2023)

ue_1999_2008 = bsl_payload('LNS14000000', 1999, 2008)
ue_2009_2018 = bsl_payload('LNS14000000', 2009, 2018)
ue_2018_2023= bsl_payload('LNS14000000', 2018, 2023)

cpi = bind_rows(cpi_1999_2008, cpi_2009_2018, cpi_2018_2023) #Combine all CPI tables
ue = bind_rows(ue_1999_2008, ue_2009_2018, ue_2018_2023) #Combine all UE tables

#----FED Rate----
#API call for FRED to get fed-funds-rate
fred_res = GET("https://api.stlouisfed.org/fred/series/observations",
               query = list(
                 series_id = 'FEDFUNDS',
                 api_key = '1384298aeab27419f2e59acb18554185',
                 file_type = 'json',
                 frequency = 'm',
                 observation_start = '1999-02-15',
                 observation_end = '2024-02-15'))

fred_json = content(fred_res, "text") 
fred_json = fromJSON(fred_json) #Extract JSON from response
fed  = data.frame(matrix(unlist(fred_json$observations), 
                         nrow = length(fred_json$observations), byrow = TRUE)) #Extract data table
colnames(fed) = c('x', 'y', 'Date', 'FFR') #Rename column
fed = select(fed, c(Date, FFR)) #Remove unneeded columns

#----Handle Dates in data frames----
ue$Date = paste(ue$periodName, ue$year, sep = ' ')
cpi$Date = paste(cpi$periodName, cpi$year, sep = ' ')
#----Save Data----
#Locally save data frames as CSV
#write.csv(cpi, 'cpi.csv')
#write.csv(fed, 'fed.csv')
#write.csv(ue, 'ue.csv')

The code above returns three separate datasets for the three measures. Using Excel, the below graphs were plotted.

Time Series Analysis

Investigating the graph above, it becomes apparent that the unemployment rate (blue) and the inflation rate (orange) work often times in contrast to each other. When one goes up, the other goes down. Additionally, and more importantly, this is seemingly aligned with the funds rate. There appears to be a slight lag of unemployment and inflation rates moving, and the FED adjusting the funds rate to correct for it. For example, after the COVID-19 pandemic, inflation has risen substantially, and while unemployment was high to begin with, the FED needed to regain control of both, and subsequently started to raise rates in 2021. Reactive to the fiscal measurements. Similarly, during the 2008 financial crisis the opposite happened, a deflation was occurring with very high unemployment, leading the FED to scale down the funds rate to 0, regaining control.

The time series shows that all three rates have a predictable, cyclical pattern.

Correlation Analysis

The scatter plot above depicts the correlations between unemployment and inflation rates with the FFR for each month of the last 25-years. It appears that there seems to be an interaction effect between unemployment and inflation rate, with the crossing point being at about 5.5% FFR. A regression shows to be statistically significant, while the interaction effect with UE*CPI does not appear to be statistically significant itself. Additionally, tracing both linear effects, it appears that they do work in the contrary with the FFR. While unemployment seems to decrease with increasing FFR, the inflation rate increases raising FFR. This suggests that the FED may not be able to control both at the same time, while there is the possibility of a lag, which would not be captured in this graph.

Distribution Analysis

Lastly, the data was grouped into two: FFR below and above 4%, and the distributions were plotted. The box-plots show that there is much more variability for both, UE and CPI, when the FFR is above 4%, compared to below. Also, the median UE rate is lower when the FFR is below 4%, while the opposite is true for the CPI. These group differences also seem to be statistically significant using a t-test.

Overall, putting the insights of both plots together, it appears that the FED is able to maintain control of both, unemployment rate and inflation rate, therefore serving the mandate given by congress. However, it does appear that the FED has substantially more control over the inflation rate than the unemployment rate, and that there are time-lags apparent that require additional analysis. This makes sense, because the inflation rate reflects spending behavior, and if it is more expensive to borrow money (e.g., funds rate is high), spending will decrease. Lastly, UE and CPI appear to be much less variable during low FFR than high.