Personal Consumption Expenditures (PCE)
cpi <-fredr_series_observations(series_id = "CPIAUCNS",
observation_start = as.Date("2019-01-01"))
pce <-fredr_series_observations(series_id = "PCE",
observation_start = as.Date("2019-01-01"))
pce %>% ggplot() +
geom_line(mapping = aes(x=date,y=value),size=1,color="red" ) +
labs(title = "Personal Consumption Expenditure (PCE)",
subtitle = str_glue("From {min(pce$date)} through {max(pce$date)}"),
x="Time", y="Millions of Dollars",
caption = "Data source: FRED Federal Reserve. Illustration by @JoeLongSanDiego")+
theme_economist()

#------------------------------------------------------
cpi %>% ggplot() +
geom_line(mapping = aes(x=date,y=value),size=1,color="red" ) +
labs(title = " Consumer Price Index (CPI)",
subtitle = str_glue("From {min(cpi$date)} through {max(cpi$date)}"),
x="Time", y="Index 1982-1984=100",
caption = "Data source: FRED Federal Reserve. Illustration by @JoeLongSanDiego")+
theme_economist()

Flexible Price Consumer Price Index (FLEXCPIM158SFRBATL)
Sticky Price Consumer Price Index (STICKCPIM158SFRBATL)
Percent Change at Annual Rate
- Flexible-priced items (like gasoline) are free to adjust quickly to changing market conditions
- Sticky-priced items (like prices at the laundromat) are subject to some impediment or cost that causes them to change prices infrequently.
- Sticky prices appear to have an embedded inflation expectations component that is indicative in forecasting future inflation.
index <-fredr_series_observations(series_id = "FLEXCPIM158SFRBATL",
observation_start = as.Date("2019-01-01"))
index2 <-fredr_series_observations(series_id = "STICKCPIM158SFRBATL",
observation_start = as.Date("2019-01-01"))
indicator <-as.data.frame(index$date)
colnames(indicator) <- "date"
indicator$flexible <- index$value
indicator$sticky <- index2$value
indicator %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" ) %>%
column_spec(3, T, color = "blue")
date
|
flexible
|
sticky
|
2019-01-01
|
-8.050
|
2.7196
|
2019-02-01
|
5.154
|
2.2794
|
2019-03-01
|
9.079
|
2.8219
|
2019-04-01
|
8.393
|
2.7337
|
2019-05-01
|
-2.401
|
2.3360
|
2019-06-01
|
-3.989
|
3.0500
|
2019-07-01
|
3.817
|
3.1039
|
2019-08-01
|
-4.767
|
3.2038
|
2019-09-01
|
-0.973
|
2.3455
|
2019-10-01
|
2.449
|
3.2778
|
2019-11-01
|
3.480
|
2.6228
|
2019-12-01
|
3.980
|
2.2534
|
2020-01-01
|
-1.754
|
3.3893
|
2020-02-01
|
-1.800
|
2.2666
|
2020-03-01
|
-18.157
|
0.9873
|
2020-04-01
|
-23.709
|
-1.6833
|
2020-05-01
|
-4.777
|
1.0458
|
2020-06-01
|
23.014
|
3.1380
|
2020-07-01
|
10.955
|
6.6647
|
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Index","Value")
# plotting data
data_long %>% ggplot() +
geom_line(mapping = aes(x=date,y=Value,color=Index),size=1) +
labs(title = "Consumer Price Index: Flexible Prices / Sticky Prices \nDuring COVID19 Pandemic",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
x="Monthly", y="% Percent Change Annualized",
caption = "Data source: FRED Federal Reserve. Illustration by @JoeLongSanDiego")+
theme_economist()

highchart() %>%
hc_chart(type = "column") %>%
hc_xAxis(categories = indicator$date) %>%
hc_add_series(name="Flexible Prices",data = indicator$flexible) %>%
hc_add_series(name="Sticky Prices",data = indicator$sticky) %>%
hc_subtitle(text=str_glue("From {min(indicator$date)} through {max(indicator$date)}"), align = "center") %>%
hc_title(text = "Consumer Price Index: Flexible Prices / Sticky Prices _ during COVID19 Pandemic",
style = list(fontWeight = "bold", fontSize = "20px"),
align = "center") %>%
hc_credits(enabled = TRUE,text = "Data Source: FRED Federal Reserve _ Illustration by @JoeLongSanDiego") %>%
hc_yAxis(title = list(text = "% Percent Change")) %>%
hc_add_theme(hc_theme_economist())
Steak, Sirloin, USDA Choice, Boneless, Per Lb. (453.6 Gm) in U.S. City Average (APU0000703613)
Chicken, Fresh, Whole, Per Lb. (453.6 Gm) in U.S. City Average (APU0000706111)
All Pork Chops, Per Lb. (453.6 Gm) in U.S. City Average (APU0000FD3101)
Frankfurters, All Meat or All Beef, Per Lb. (453.6 Gm) in U.S. City Average (APU0000705111)
Ground Beef, 100% Beef, Per Lb. (453.6 Gm) in U.S. City Average (APU0000703112)
Global price of Fish (PSALMUSDM)
Global price of Shrimp (PSHRIUSDM)
index <-fredr_series_observations(series_id = "APU0000703613",
observation_start = as.Date("2019-01-01"))
index2 <-fredr_series_observations(series_id = "APU0000706111",
observation_start = as.Date("2019-01-01"))
index3 <-fredr_series_observations(series_id = "APU0000FD3101",
observation_start = as.Date("2019-01-01"))
index4 <-fredr_series_observations(series_id = "APU0000703112",
observation_start = as.Date("2019-01-01"))
indicator <-as.data.frame(index$date)
colnames(indicator) <- "date"
indicator$steak <- index$value
indicator$chicken <- index2$value
indicator$pork <- index3$value
indicator$ground <- index4$value
indicator %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" ) %>%
column_spec(3, T, color = "blue") %>%
column_spec(4, T, color = "green") %>%
column_spec(5, T, color = "brown")
date
|
steak
|
chicken
|
pork
|
ground
|
2019-01-01
|
8.348
|
1.473
|
3.199
|
3.801
|
2019-02-01
|
8.529
|
1.486
|
3.298
|
3.758
|
2019-03-01
|
8.575
|
1.468
|
3.311
|
3.725
|
2019-04-01
|
8.706
|
1.463
|
3.354
|
3.775
|
2019-05-01
|
8.662
|
1.479
|
3.441
|
3.822
|
2019-06-01
|
8.133
|
1.590
|
3.312
|
3.812
|
2019-07-01
|
8.284
|
1.562
|
3.411
|
3.800
|
2019-08-01
|
8.134
|
1.514
|
3.379
|
3.819
|
2019-09-01
|
8.083
|
1.487
|
3.335
|
3.851
|
2019-10-01
|
8.225
|
1.538
|
3.238
|
3.841
|
2019-11-01
|
8.318
|
1.430
|
3.399
|
3.812
|
2019-12-01
|
8.481
|
1.450
|
3.391
|
3.862
|
2020-01-01
|
8.441
|
1.409
|
3.368
|
3.886
|
2020-02-01
|
8.333
|
1.362
|
3.419
|
3.865
|
2020-03-01
|
8.265
|
1.400
|
3.415
|
3.881
|
2020-04-01
|
8.600
|
1.571
|
3.673
|
4.052
|
2020-05-01
|
9.480
|
NA
|
3.972
|
4.461
|
2020-06-01
|
10.423
|
1.747
|
4.189
|
4.737
|
2020-07-01
|
9.413
|
1.712
|
3.910
|
4.264
|
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Index","Value")
# plotting data
data_long %>% ggplot() +
geom_line(mapping = aes(x=date,y=Value,color=Index),size=1) +
labs(title = "Supply and demand shocks to food prices \nDuring COVID19 Pandemic",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
x="Monthly", y="% Percent Change Annualized",
caption = "Data source: FRED Federal Reserve. Illustration by @JoeLongSanDiego")+
theme_economist()

highchart() %>%
hc_chart(type = "column") %>%
hc_xAxis(categories = indicator$date) %>%
hc_add_series(name="Steak _ Sirloin",data = indicator$steak) %>%
hc_add_series(name="Chicken _ whole",data = indicator$chicken) %>%
hc_add_series(name="All Pork",data = indicator$pork) %>%
hc_subtitle(text=str_glue("From {min(indicator$date)} through {max(indicator$date)}"), align = "center") %>%
hc_title(text = "Supply and demand shocks to food prices _ during COVID19 Pandemic",
style = list(fontWeight = "bold", fontSize = "20px"),
align = "center") %>%
hc_credits(enabled = TRUE,text = "Data Source: FRED Federal Reserve _ Illustration by @JoeLongSanDiego") %>%
hc_yAxis(title = list(text = "% Percent Change")) %>%
hc_add_theme(hc_theme_economist())
Consumer Price Index for All Urban Consumers: Pet Food in U.S. City Average (CUUR0000SS61031)
Consumer Price Index for All Urban Consumers: Apparel in U.S. City Average (CPIAPPNS)
Consumer Price Index for All Urban Consumers: Women’s and Girls’ Apparel in U.S. City Average (CUUR0000SAA2)
Consumer Price Index for All Urban Consumers: Men’s and Boys’ Apparel in U.S. City Average (CUUR0000SAA1)
index <-fredr_series_observations(series_id = "CUUR0000SAA2",
observation_start = as.Date("2019-01-01"))
index2 <-fredr_series_observations(series_id = "CUUR0000SAA1",
observation_start = as.Date("2019-01-01"))
indicator <-as.data.frame(index$date)
colnames(indicator) <- "date"
indicator$female <- index$value
indicator$male <- index2$value
indicator %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" ) %>%
column_spec(3, T, color = "blue")
date
|
female
|
male
|
2019-01-01
|
104.83
|
117.2
|
2019-02-01
|
107.61
|
123.0
|
2019-03-01
|
109.63
|
120.1
|
2019-04-01
|
110.15
|
118.1
|
2019-05-01
|
108.08
|
118.2
|
2019-06-01
|
106.79
|
117.0
|
2019-07-01
|
104.11
|
116.3
|
2019-08-01
|
105.73
|
117.8
|
2019-09-01
|
109.60
|
122.6
|
2019-10-01
|
107.70
|
122.6
|
2019-11-01
|
105.18
|
117.2
|
2019-12-01
|
101.56
|
112.4
|
2020-01-01
|
101.63
|
116.5
|
2020-02-01
|
106.22
|
120.1
|
2020-03-01
|
106.80
|
119.1
|
2020-04-01
|
101.65
|
112.7
|
2020-05-01
|
96.65
|
110.1
|
2020-06-01
|
95.96
|
110.7
|
2020-07-01
|
94.21
|
110.3
|
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Index","Value")
# plotting data
data_long %>% ggplot() +
geom_line(mapping = aes(x=date,y=Value,color=Index),size=1) +
labs(title = "Apparel Sales by Gender _ During COVID19 Pandemic",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
x="Monthly", y="Index 1982-1984=100",
caption = "Data source: FRED Federal Reserve. Illustration by @JoeLongSanDiego")+
theme_economist()

highchart() %>%
hc_chart(type = "column") %>%
hc_xAxis(categories = indicator$date) %>%
hc_add_series(name="Women and Girls'",data = indicator$female) %>%
hc_add_series(name="Men's and Boys' Apparel",data = indicator$male) %>%
hc_subtitle(text=str_glue("From {min(indicator$date)} through {max(indicator$date)}"), align = "center") %>%
hc_title(text = "Consumer Price Index: Apparel_ during COVID19 Pandemic",
style = list(fontWeight = "bold", fontSize = "20px"),
align = "center") %>%
hc_credits(enabled = TRUE,text = "Data Source: FRED Federal Reserve _ Illustration by @JoeLongSanDiego") %>%
hc_yAxis(title = list(text = "Index 1982-1984=100")) %>%
hc_add_theme(hc_theme_economist())