Story 2: Has the FED been able to fulfill the mandate given to it by Congress?
Author
Andreina Arias
Introduction
The Federal Reserve’s mandate from Congress is to control inflation and to maintain low unemployment. Using data from 2020 through 2025 found in US Bureau of labor Statistics (BLS) to obtain the Consumer Price Index(CPI) and unemployment rate, and in Federal Reserve Bank of St.Louis to obtain the federal fund interest rate. The data on CPI would be used to look at inflation overtime. I’ll be using data visualizations to answer the question “Has the FED been able to fulfill the mandate given to it by Congress?”
Libraries loaded
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(jsonlite)
Warning: package 'jsonlite' was built under R version 4.4.1
Attaching package: 'jsonlite'
The following object is masked from 'package:purrr':
flatten
Warning: package 'patchwork' was built under R version 4.4.1
library(dplyr)library(tidyr)
Unemployment data (2020-2025) from BLS, I tried to use API scraping but I had exceeded my access to the BLS for the day. Instead I obtained the data from an excel sheet provided by BLS converted it into a CSV and uploaded it to github in order to use it for this assignment.
Rows: 38 Columns: 13
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (13): X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
colnames(Unemployment)<-Unemployment[12,]#column names on row 12Unemployment<-Unemployment[-(1:12),] #removed first 10 rowmonth_mapping <-c("Jan"=1, "Feb"=2, "Mar"=3, "Apr"=4, "May"=5, "Jun"=6, "Jul"=7, "Aug"=8, "Sep"=9, "Oct"=10, "Nov"=11, "Dec"=12)# Change dates to merge with other data setsUnemployment<- Unemployment %>%pivot_longer(cols = Jan:Dec, names_to ="Month", values_to ="Value") %>%mutate(Month = month_mapping[Month], # Convert month names to numbersDate =as.Date(paste(Year, Month, "01", sep ="-"))) %>%select(Year, Date, Value)Unemployment$Value <-as.numeric(Unemployment$Value)Unemployment2<- Unemployment|>rename(ValueUne=Value)print(Unemployment)
Rows: 38 Columns: 15
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (15): X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
colnames(CPI)<-CPI[12,]#column names on row 12CPI<-CPI[-(1:12),-(14:15)] #removed first 10 row and last two columnsprint(CPI)
month_mapping <-c("Jan"=1, "Feb"=2, "Mar"=3, "Apr"=4, "May"=5, "Jun"=6, "Jul"=7, "Aug"=8, "Sep"=9, "Oct"=10, "Nov"=11, "Dec"=12)CPI2 <- CPI %>%# Pivot the data from wide to long formatpivot_longer(cols = Jan:Dec, names_to ="Month", values_to ="Value") %>%# Convert month abbreviation to numeric monthmutate(Month = month_mapping[Month],# Create a Date column by combining Year and MonthDate =as.Date(paste(Year, Month, "01", sep ="-"))) %>%# Select the relevant columnsselect(Year, Date, Value)CPI2$Value <-as.numeric(CPI2$Value)CPI3<- CPI2|>rename(ValueCPI=Value)
FRED/Federal Reserve Economic Data from 2020-2025 was obtained using API.
file_path <-"~/Downloads/config.json"config <-fromJSON(file_path)api_key <- config$FRED_API_KEYfredr_set_key(api_key)if (fredr_has_key()) {fedfunds_data<-fredr(series_id ="FEDFUNDS",observation_start =as.Date("2000-01-01"),observation_end =as.Date("2025-01-01"),frequency ="m")}# View the first few rows of the datahead(fedfunds_data)
Visual: CPI increases overtime with an upward trend. In 2020 I wouldn’t belive the FED increase to cause the unemployment rate to increase after because this was also the peak of the Covid-19 pandemic where nonessential employees were expected to in doors, leading to many people being lead off. In 2009-2010, I would say the FED caused an increase in unemployment rate while trying to decrease CPI.
Looking at the correlation coefficient it is seen that CPI and Federal fund have no correlation due to the -.04 coefficient that is nearly zero. The Unemployment rate and CPI also have no correlation since the coefficient is -0.2. The correlation between unemployment and federal fund have a moderate to strong negative correlation, as their coefficient would be -0.6, this means as unemployment rate goes down the federal reverse fund would go up.
#merge data for correlationmerged <- fedfunds %>%left_join(CPI3, by ="Date") %>%left_join(Unemployment2, by ="Date")correlation_matrix <-cor(merged %>%select(ValueCPI, ValueFed, ValueUne), method ="pearson")print(correlation_matrix)
Using the visual to answer the question on whether the FED been able to fulfill the mandate given to it by Congress, it seem the FED weren’t able to mandate price stability based on the CPI value plot but they seemed to have help with unemployment. As the federal reserve system is responsible for the dual mandate which is to maximize employment and keeping price stability, overall I would say the Federal Reverse System has tried to fulfill their given mandate by the Congress because CPI has been increasing the Federal fund has increased to try and slow down inflation and unemployment rate has been decreasing. Currently, the Federal fund interest rate increased in result to CPI increase without increasing unemployment rate is really low proving that the FED is fulfilling the mandate. I did a correlation test confirm the relationship between the three variables, and found that only unemployment rate and federal reverse fund had a relationship which was negitive.
Data Sources:
The Consumer Price Index (CPI) (Bureau of Labor Statistics):