Consumer Sentiment as general trends.

senti <- 
  "UMCSENT" %>% 
  tq_get(get = "economic.data", from = "2015-01-01") %>%
  rename(count = price) 
## Registered S3 method overwritten by 'tune':
##   method                   from   
##   required_pkgs.model_spec parsnip
  senti %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "firebrick2",size=.8) + 
    labs(
      x = "",
      y = "",
      title = "Consumer Sentiment Index per University of Michigan",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(senti$date)} through {max(senti$date)}")
    ) +
    theme_economist()

indicator <-fredr_series_observations(series_id = "PCE", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator,n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(1:3, T, color = "blue" ) 
date series_id value realtime_start realtime_end
2019-10-01 PCE 14608 2021-10-31 2021-10-31
2019-11-01 PCE 14668 2021-10-31 2021-10-31
2019-12-01 PCE 14686 2021-10-31 2021-10-31
2020-01-01 PCE 14770 2021-10-31 2021-10-31
2020-02-01 PCE 14785 2021-10-31 2021-10-31
2020-03-01 PCE 13762 2021-10-31 2021-10-31
2020-04-01 PCE 12022 2021-10-31 2021-10-31
2020-05-01 PCE 13058 2021-10-31 2021-10-31
2020-06-01 PCE 13889 2021-10-31 2021-10-31
2020-07-01 PCE 14129 2021-10-31 2021-10-31
2020-08-01 PCE 14270 2021-10-31 2021-10-31
2020-09-01 PCE 14482 2021-10-31 2021-10-31
2020-10-01 PCE 14546 2021-10-31 2021-10-31
2020-11-01 PCE 14467 2021-10-31 2021-10-31
2020-12-01 PCE 14390 2021-10-31 2021-10-31
2021-01-01 PCE 14858 2021-10-31 2021-10-31
2021-02-01 PCE 14700 2021-10-31 2021-10-31
2021-03-01 PCE 15459 2021-10-31 2021-10-31
2021-04-01 PCE 15619 2021-10-31 2021-10-31
2021-05-01 PCE 15624 2021-10-31 2021-10-31
2021-06-01 PCE 15802 2021-10-31 2021-10-31
2021-07-01 PCE 15812 2021-10-31 2021-10-31
2021-08-01 PCE 15967 2021-10-31 2021-10-31
2021-09-01 PCE 16060 2021-10-31 2021-10-31
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Personal Consumption Expenditures (PCE)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Real Personal Consumption Expenditures: Services (PCESC96)

indicator <-fredr_series_observations(series_id = "PCESC96", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator,n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(3, T, color = "red" ) 
date series_id value realtime_start realtime_end
2019-10-01 PCESC96 8492 2021-10-31 2021-10-31
2019-11-01 PCESC96 8518 2021-10-31 2021-10-31
2019-12-01 PCESC96 8508 2021-10-31 2021-10-31
2020-01-01 PCESC96 8544 2021-10-31 2021-10-31
2020-02-01 PCESC96 8550 2021-10-31 2021-10-31
2020-03-01 PCESC96 7759 2021-10-31 2021-10-31
2020-04-01 PCESC96 6814 2021-10-31 2021-10-31
2020-05-01 PCESC96 7206 2021-10-31 2021-10-31
2020-06-01 PCESC96 7632 2021-10-31 2021-10-31
2020-07-01 PCESC96 7733 2021-10-31 2021-10-31
2020-08-01 PCESC96 7817 2021-10-31 2021-10-31
2020-09-01 PCESC96 7895 2021-10-31 2021-10-31
2020-10-01 PCESC96 7935 2021-10-31 2021-10-31
2020-11-01 PCESC96 7917 2021-10-31 2021-10-31
2020-12-01 PCESC96 7899 2021-10-31 2021-10-31
2021-01-01 PCESC96 7962 2021-10-31 2021-10-31
2021-02-01 PCESC96 7939 2021-10-31 2021-10-31
2021-03-01 PCESC96 8080 2021-10-31 2021-10-31
2021-04-01 PCESC96 8157 2021-10-31 2021-10-31
2021-05-01 PCESC96 8214 2021-10-31 2021-10-31
2021-06-01 PCESC96 8272 2021-10-31 2021-10-31
2021-07-01 PCESC96 8336 2021-10-31 2021-10-31
2021-08-01 PCESC96 8373 2021-10-31 2021-10-31
2021-09-01 PCESC96 8404 2021-10-31 2021-10-31
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Real Personal Consumption Expenditures: Services (PCESC96)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Real personal consumption expenditures: Food (DFXARX1M020SBEA)

indicator <-fredr_series_observations(series_id = "DFXARX1M020SBEA", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator,n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(3, T, color = "red" ) 
date series_id value realtime_start realtime_end
2019-10-01 DFXARX1M020SBEA 993 2021-10-31 2021-10-31
2019-11-01 DFXARX1M020SBEA 994 2021-10-31 2021-10-31
2019-12-01 DFXARX1M020SBEA 998 2021-10-31 2021-10-31
2020-01-01 DFXARX1M020SBEA 995 2021-10-31 2021-10-31
2020-02-01 DFXARX1M020SBEA 992 2021-10-31 2021-10-31
2020-03-01 DFXARX1M020SBEA 1213 2021-10-31 2021-10-31
2020-04-01 DFXARX1M020SBEA 1042 2021-10-31 2021-10-31
2020-05-01 DFXARX1M020SBEA 1067 2021-10-31 2021-10-31
2020-06-01 DFXARX1M020SBEA 1060 2021-10-31 2021-10-31
2020-07-01 DFXARX1M020SBEA 1074 2021-10-31 2021-10-31
2020-08-01 DFXARX1M020SBEA 1059 2021-10-31 2021-10-31
2020-09-01 DFXARX1M020SBEA 1068 2021-10-31 2021-10-31
2020-10-01 DFXARX1M020SBEA 1060 2021-10-31 2021-10-31
2020-11-01 DFXARX1M020SBEA 1067 2021-10-31 2021-10-31
2020-12-01 DFXARX1M020SBEA 1047 2021-10-31 2021-10-31
2021-01-01 DFXARX1M020SBEA 1104 2021-10-31 2021-10-31
2021-02-01 DFXARX1M020SBEA 1078 2021-10-31 2021-10-31
2021-03-01 DFXARX1M020SBEA 1127 2021-10-31 2021-10-31
2021-04-01 DFXARX1M020SBEA 1117 2021-10-31 2021-10-31
2021-05-01 DFXARX1M020SBEA 1106 2021-10-31 2021-10-31
2021-06-01 DFXARX1M020SBEA 1113 2021-10-31 2021-10-31
2021-07-01 DFXARX1M020SBEA 1095 2021-10-31 2021-10-31
2021-08-01 DFXARX1M020SBEA 1121 2021-10-31 2021-10-31
2021-09-01 DFXARX1M020SBEA 1120 2021-10-31 2021-10-31
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Chained 2012 Dollars",
      x = "Monthly", 
      title = "Real personal consumption expenditures: Food (DFXARX1M020SBEA)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Real Personal Consumption Expenditures: Durable Goods (PCEDGC96)

indicator <-fredr_series_observations(series_id = "PCEDGC96", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator[,c(1,3)],n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(1:2, T, color = "blue" ) 
date value
2019-10-01 1776
2019-11-01 1802
2019-12-01 1806
2020-01-01 1816
2020-02-01 1811
2020-03-01 1588
2020-04-01 1420
2020-05-01 1810
2020-06-01 1965
2020-07-01 2016
2020-08-01 2026
2020-09-01 2050
2020-10-01 2075
2020-11-01 2044
2020-12-01 1990
2021-01-01 2210
2021-02-01 2117
2021-03-01 2434
2021-04-01 2421
2021-05-01 2279
2021-06-01 2248
2021-07-01 2158
2021-08-01 2147
2021-09-01 2137
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Chained 2012 Dollars",
      x = "Monthly", 
      title = "Real Personal Consumption Expenditures: Durable Goods (PCEDGC96)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Personal current transfer receipts: Government social benefits to persons (A063RC1)

indicator <-fredr_series_observations(series_id = "A063RC1", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date series_id value realtime_start realtime_end
2021-04-01 A063RC1 4656 2021-10-31 2021-10-31
2021-05-01 A063RC1 4109 2021-10-31 2021-10-31
2021-06-01 A063RC1 4009 2021-10-31 2021-10-31
2021-07-01 A063RC1 4125 2021-10-31 2021-10-31
2021-08-01 A063RC1 4144 2021-10-31 2021-10-31
2021-09-01 A063RC1 3847 2021-10-31 2021-10-31
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Government social benefits to persons ",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Employment during COVID19 pandemic

labor <- 
  "PAYEMS" %>% 
  tq_get(get = "economic.data", from = "2015-01-01") %>%
   rename(count = price) 

  labor %>% 
    ggplot(aes(x = date, y = count)) +
    geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "firebrick4",size=.8) + 
    labs(
      x = "",
      y = "",
      title = "Total Labor Force",   
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(labor$date)} through {max(labor$date)}")
    ) +
  
     theme_economist()

Total Unemployed (U6RATE)

u6 <- 
  "U6RATE" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") %>%
   rename(count = price) 

  u6 %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "blue",size=1.2) + 
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    labs(
      x = "",
      y = "Percent",
      title = "Total Unemployed Rate (U6Rate)", 
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(u6$date)} through {max(u6$date)}")
    ) +
  
     theme_economist()

Personal consumption expenditures: Food (DFXARC1M027SBEA)

indicator <-fredr_series_observations(series_id = "DFXARC1M027SBEA", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date series_id value realtime_start realtime_end
2021-04-01 DFXARC1M027SBEA 1223 2021-10-31 2021-10-31
2021-05-01 DFXARC1M027SBEA 1215 2021-10-31 2021-10-31
2021-06-01 DFXARC1M027SBEA 1232 2021-10-31 2021-10-31
2021-07-01 DFXARC1M027SBEA 1220 2021-10-31 2021-10-31
2021-08-01 DFXARC1M027SBEA 1254 2021-10-31 2021-10-31
2021-09-01 DFXARC1M027SBEA 1265 2021-10-31 2021-10-31
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Personal consumption expenditures: Food",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Consumer Price Index for All Urban Consumers: Meats, Poultry, Fish, and Eggs in U.S. City Average (CUSR0000SAF112)

mpfe <- 
  "CUSR0000SAF112" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") 

  mpfe %>% 
    ggplot(aes(x = date, y = price)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "gold4",size=.8) + 
    
    labs(
      x = "",
      y = "Index 1982-1984=100", 
      caption = "Index 1982-1984=100,Seasonally Adjusted\n
      Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      title = "CPI : Meats, Poultry, Fish, and Eggs (CUSR0000SAF112)",
      subtitle = str_glue("From {min(mpfe$date)} through {max(mpfe$date)}")
    ) +
  
     theme_economist()

cpi <- 
  "CPIAUCSL" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") %>%
  rename(count = price) 

  cpi %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "goldenrod4",size=.8) + 
    labs(
      x = "",
      y = "", caption = "Index 1982-1984=100,Seasonally Adjusted",
      title = "Consumer Price Index: All Items in U.S. City Average (CPIAUCSL)",
      subtitle = str_glue("Monthly from {min(cpi$date)} through {max(cpi$date)}")
    ) +
    theme(plot.title = element_text(color="blue", size=14, face="bold"))

Consumer Price Index for All Urban Consumers: Food at Home in U.S. City Average (CUSR0000SAF11)

food <- 
  "CUSR0000SAF11" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") %>%
  rename(count = price) 

  food %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "goldenrod4",size=.8) + 
    labs(
      x = "",
      y = "", caption = "Index 1982-1984=100,Seasonally Adjusted",
      title = "CPI: Food at Home in U.S. City Average (CUSR0000SAF11)",
      subtitle = str_glue("Monthly from {min(food$date)} through {max(food$date)}")
    ) +
    theme_economist()+
    theme(plot.title = element_text(color="blue", size=15, face="bold"))

CPI Average Price Data, U.S. city average (AP) (Select from list below) Bacon, sliced, per lb. - APU0000704111 Bananas, per lb. - APU0000711211 Bread, white, pan, per lb. - APU0000702111 Chicken, fresh, whole, per lb. - APU0000706111 Coffee, 100%, ground roast, all sizes, per lb. - APU0000717311 Eggs, grade A, large, per doz. - APU0000708111 Flour, white, all purpose, per lb. - APU0000701111 Milk, fresh, whole, fortified, per gal. - APU0000709112 Oranges, navel, per lb. - APU0000711311 Rice, white, long grain, uncooked, per lb. - APU0000701312 Tomatoes, field grown, per lb. - APU0000712311 Electricity per KWH - APU000072610 Fuel oil #2 per gallon - APU000072511 Gasoline, all types, per gallon - APU00007471A Gasoline, unleaded regular, per gallon - APU000074714

library(blscrapeR)
library(tidyverse)

df <- bls_api(c("APU0000704111", "APU0000706111","APU0000708111","APU0000709112"), 
              startyear = 2019, endyear = 2020)  %>%
    spread(seriesID, value) %>% dateCast() %>%
   rename(chicken=APU0000706111,egg=APU0000708111,beacon=APU0000704111,milk=APU0000709112)
## REQUEST_SUCCEEDED
ggplot(data = df, aes(x = date)) + 
    geom_line(aes(y = chicken, color = "chicken"),size=.8) +
    geom_line(aes(y = egg, color = "egg"),size=.8) + 
    geom_line(aes(y = beacon, color = "beacon"),size=.8) +
    geom_line(aes(y = milk, color = "milk"),size=.8) +
    labs(title = "Food Prices During COVID19 Pandemic", y="Price", x="Date") +
    theme_economist()+
    theme(legend.position="top", plot.title = element_text(hjust = 0.5))