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
library(blscrapeR)
library(fredr)
library(ggplot2)
library(patchwork)
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.

Unemployment<-read_csv("https://raw.githubusercontent.com/Andreina-A/Story2/refs/heads/main/SeriesReport-20250223134640_626d2f.csv",col_names = FALSE)
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 12
Unemployment<-Unemployment[-(1:12),] #removed first 10 row

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
)

# Change dates to merge with other data sets
Unemployment<- Unemployment  %>%
  pivot_longer(cols = Jan:Dec, names_to = "Month", values_to = "Value") %>%
  mutate(Month = month_mapping[Month],  # Convert month names to numbers
         Date = as.Date(paste(Year, Month, "01", sep = "-"))) %>%
  select(Year, Date, Value)

Unemployment$Value <- as.numeric(Unemployment$Value)

Unemployment2<- Unemployment|>
  rename(ValueUne=Value)

print(Unemployment)
# A tibble: 312 × 3
   Year  Date       Value
   <chr> <date>     <dbl>
 1 2000  2000-01-01   4  
 2 2000  2000-02-01   4.1
 3 2000  2000-03-01   4  
 4 2000  2000-04-01   3.8
 5 2000  2000-05-01   4  
 6 2000  2000-06-01   4  
 7 2000  2000-07-01   4  
 8 2000  2000-08-01   4.1
 9 2000  2000-09-01   3.9
10 2000  2000-10-01   3.9
# ℹ 302 more rows

CPI Data from years 2020-2025, from github.

CPI<-read_csv("https://raw.githubusercontent.com/Andreina-A/Story2/refs/heads/main/SeriesReport-20250223141825_b978fd.csv",col_names = FALSE)
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 12

CPI<-CPI[-(1:12),-(14:15)] #removed first 10 row and last two columns

print(CPI)
# A tibble: 26 × 13
   Year  Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep   Oct   Nov   Dec  
   <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
 1 2000  168.8 169.8 171.2 171.3 171.5 172.4 172.8 172.8 173.7 174.0 174.1 174.0
 2 2001  175.1 175.8 176.2 176.9 177.7 178.0 177.5 177.5 178.3 177.7 177.4 176.7
 3 2002  177.1 177.8 178.8 179.8 179.8 179.9 180.1 180.7 181.0 181.3 181.3 180.9
 4 2003  181.7 183.1 184.2 183.8 183.5 183.7 183.9 184.6 185.2 185.0 184.5 184.3
 5 2004  185.2 186.2 187.4 188.0 189.1 189.7 189.4 189.5 189.9 190.9 191.0 190.3
 6 2005  190.7 191.8 193.3 194.6 194.4 194.5 195.4 196.4 198.8 199.2 197.6 196.8
 7 2006  198.3 198.7 199.8 201.5 202.5 202.9 203.5 203.9 202.9 201.8 201.5 201.8
 8 2007  202.… 203.… 205.… 206.… 207.… 208.… 208.… 207.… 208.… 208.… 210.… 210.…
 9 2008  211.… 211.… 213.… 214.… 216.… 218.… 219.… 219.… 218.… 216.… 212.… 210.…
10 2009  211.… 212.… 212.… 213.… 213.… 215.… 215.… 215.… 215.… 216.… 216.… 215.…
# ℹ 16 more rows

Continuation of data wrangling for 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 format
  pivot_longer(cols = Jan:Dec, names_to = "Month", values_to = "Value") %>%
  # Convert month abbreviation to numeric month
  mutate(Month = month_mapping[Month],
         # Create a Date column by combining Year and Month
         Date = as.Date(paste(Year, Month, "01", sep = "-"))) %>%
  # Select the relevant columns
  select(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_KEY

fredr_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 data
head(fedfunds_data)
# A tibble: 6 × 5
  date       series_id value realtime_start realtime_end
  <date>     <chr>     <dbl> <date>         <date>      
1 2000-01-01 FEDFUNDS   5.45 2025-02-23     2025-02-23  
2 2000-02-01 FEDFUNDS   5.73 2025-02-23     2025-02-23  
3 2000-03-01 FEDFUNDS   5.85 2025-02-23     2025-02-23  
4 2000-04-01 FEDFUNDS   6.02 2025-02-23     2025-02-23  
5 2000-05-01 FEDFUNDS   6.27 2025-02-23     2025-02-23  
6 2000-06-01 FEDFUNDS   6.53 2025-02-23     2025-02-23  
write.csv(fedfunds_data, "fedfunds_data.csv", row.names = FALSE)

Contination on data wrangling for Fedfund

fedfunds_data$Value <- as.numeric(fedfunds_data$value)
fedfunds_data<- fedfunds_data|>
  rename(Date=date)
fedfunds<- fedfunds_data|>
  rename(ValueFed=value)

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.

p1<-ggplot(Unemployment, aes(y=Value, x=Date))+
  geom_line()+
  labs(title = "Unemployment Rate from 2000-2025",
       x="Date",
       y="Value")+
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


p2<-ggplot(CPI2, aes(y=Value, x=Date))+
  geom_line()+
  labs(title = "Consumer Price Index (CPI) from 2000-2025",
       x="Date",
       y="CPI Value")+
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

p3<-ggplot(fedfunds_data, aes(y=value, x=Date))+
  geom_line()+
  labs(title = "Federal Funds Rate from 2000-2025",
       x="Date",
       y="Value")+
  theme_minimal() +                    # Minimal theme
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

p1+p3+p2+plot_layout(ncol = 1)

Correlation test using Pearson method:

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 correlation
merged <- fedfunds %>%
  left_join(CPI3, by = "Date") %>%
  left_join(Unemployment2, by = "Date")

correlation_matrix <- cor(merged %>% select(ValueCPI, ValueFed, ValueUne), method = "pearson")
print(correlation_matrix)
            ValueCPI    ValueFed   ValueUne
ValueCPI  1.00000000 -0.04462072 -0.2151986
ValueFed -0.04462072  1.00000000 -0.5938117
ValueUne -0.21519861 -0.59381166  1.0000000

Conclusion

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):

https://data.bls.gov/toppicks?survey=bls

Github raw data for CPI: https://raw.githubusercontent.com/Andreina-A/Story2/refs/heads/main/SeriesReport-20250223141825_b978fd.csv

The FED Funds Rate (FRED) (Federal Reserve Board): https://fred.stlouisfed.org/series/FEDFUNDS

Unemployment Rate  (Bureau of Labor Statistics):

https://www.bls.gov/charts/employment-situation/civilian-unemployment-rate.htm

Github raw data for unemployment:https://raw.githubusercontent.com/Andreina-A/Story2/refs/heads/main/SeriesReport-20250223134640_626d2f.csv