General trends
# search database for a car production series
search_ls <- fredr_series_search_text("auto manufacturing employee")
search_ls$title[1:40]
## [1] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Michigan"
## [2] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Michigan"
## [3] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Michigan"
## [4] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Michigan"
## [5] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Ohio"
## [6] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Detroit-Warren-Dearborn, MI (MSA)"
## [7] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Ohio"
## [8] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Detroit-Warren-Dearborn, MI (MSA)"
## [9] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Body and Trailer Manufacturing in Elkhart-Goshen, IN (MSA)"
## [10] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Body and Trailer Manufacturing in Elkhart-Goshen, IN (MSA)"
## [11] "Full-time and part-time employees: Domestic private industries: Manufacturing: Durable goods: Motor vehicles and equipment"
## [12] "Wage and salary accruals per full-time equivalent employee: Domestic private industries: Manufacturing: Durable goods: Motor vehicles and equipment"
## [13] "All Employees: Durable Goods: Motor Vehicle Manufacturing in California"
## [14] "Full-time and part-time employees: Domestic private industries: Manufacturing: Durable goods: Motor vehicles and equipment"
## [15] "Full-time and part-time employees: Domestic private industries: Manufacturing: Durable goods: Motor vehicles and equipment"
## [16] "Wage and salary accruals per full-time equivalent employee: Domestic private industries: Manufacturing: Durable goods: Motor vehicles and equipment"
## [17] "Wage and salary accruals per full-time equivalent employee: Domestic private industries: Manufacturing: Durable goods: Motor vehicles and equipment"
## [18] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Alabama"
## [19] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Alabama"
## [20] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Kentucky"
## [21] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Kentucky"
## [22] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Missouri"
## [23] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Missouri"
## [24] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Detroit-Dearborn-Livonia, MI (MD)"
## [25] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Detroit-Dearborn-Livonia, MI (MD)"
## [26] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Warren-Troy-Farmington Hills, MI (MD)"
## [27] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in California"
## [28] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in California"
## [29] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Texas"
## [30] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Manufacturing in Texas"
## [31] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Indiana"
## [32] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Indiana"
## [33] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in New York"
## [34] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in New York"
## [35] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Ohio"
## [36] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Ohio"
## [37] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Kentucky"
## [38] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Mississippi"
## [39] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Mississippi"
## [40] "All Employees: Manufacturing: Durable Goods: Motor Vehicle Parts Manufacturing in Alabama"
- TOTALSA : Total Vehicle Sales
indicator <-fredr_series_observations(series_id = "TOTALSA",
observation_start = as.Date("2016-01-01"))
tail(indicator[,-2]) %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" )
date
|
value
|
2020-03-01
|
11.8
|
2020-04-01
|
9.1
|
2020-05-01
|
12.4
|
2020-06-01
|
13.4
|
2020-07-01
|
15.0
|
2020-08-01
|
15.6
|
indicator %>%
ggplot(aes(x = date, y = value)) +
geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
fill = "lightyellow", alpha = 0.02)+
geom_line(color = "red4",size=.8) +
labs(
y = "Millions of units",
x = "Monthly",
title = "Total Vehicle Sales",
caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
theme_economist()

DAUPSA : Domestic car production
indicator <-fredr_series_observations(series_id = "DAUPSA",
observation_start = as.Date("2016-01-01"))
tail(indicator[,-2]) %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" )
date
|
value
|
2020-03-01
|
150.2
|
2020-04-01
|
1.7
|
2020-05-01
|
46.5
|
2020-06-01
|
138.1
|
2020-07-01
|
222.0
|
2020-08-01
|
214.0
|
indicator %>%
ggplot(aes(x = date, y = value)) +
geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
fill = "lightyellow", alpha = 0.02)+
geom_line(color = "red4",size=.8) +
labs(
y = "thousands of units",
x = "Monthly",
title = "Domestic Automobile Production (DAUPSA)",
caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
theme_economist()

Motor Vehicle Retail Sales: Domestic Autos (DAUTONSA)
indicator <-fredr_series_observations(series_id = "DAUTONSA",
observation_start = as.Date("2016-01-01"))
tail(indicator[,-2]) %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" )
date
|
value
|
2020-03-01
|
209
|
2020-04-01
|
126
|
2020-05-01
|
183
|
2020-06-01
|
179
|
2020-07-01
|
221
|
2020-08-01
|
234
|
indicator %>%
ggplot(aes(x = date, y = value)) +
geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
fill = "lightyellow", alpha = 0.02)+
geom_line(color = "red4",size=.8) +
labs(
y = "Thousands of units",
x = "Monthly",
title = "Retail Sales: Domestic Autos",
caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
theme_economist()

Motor Vehicle Retail Sales: Foreign Autos (FAUTONSA)
indicator <-fredr_series_observations(series_id = "FAUTONSA",
observation_start = as.Date("2016-01-01"))
tail(indicator[,-2]) %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" )
date
|
value
|
2020-03-01
|
56
|
2020-04-01
|
41
|
2020-05-01
|
75
|
2020-06-01
|
72
|
2020-07-01
|
74
|
2020-08-01
|
73
|
indicator %>%
ggplot(aes(x = date, y = value)) +
geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
fill = "lightyellow", alpha = 0.02)+
geom_line(color = "red4",size=.8) +
labs(
y = "Thousands of units",
x = "Monthly",
title = "Retail Sales: Foreign Autos",
caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
theme_economist()

Domestic Auto Inventories (AUINSA)
indicator <-fredr_series_observations(series_id = "AUINSA",
observation_start = as.Date("2016-01-01"))
tail(indicator[,-2]) %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" )
date
|
value
|
2020-03-01
|
543
|
2020-04-01
|
462
|
2020-05-01
|
361
|
2020-06-01
|
372
|
2020-07-01
|
452
|
2020-08-01
|
476
|
indicator %>%
ggplot(aes(x = date, y = value)) +
geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
fill = "lightyellow", alpha = 0.02)+
geom_line(color = "red4",size=.8) +
labs(
y = "Thousands of units",
x = "Monthly",
title = "Domestic Auto Inventories (AUINSA)",
caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
theme_economist()

Motor Vehicle Retail Sales: Heavy Weight Trucks (HTRUCKSNSA)
indicator <-fredr_series_observations(series_id = "HTRUCKSNSA",
observation_start = as.Date("2016-01-01"))
tail(indicator[,-2]) %>% kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
column_spec(2, T, color = "red" )
date
|
value
|
2020-03-01
|
34
|
2020-04-01
|
28
|
2020-05-01
|
24
|
2020-06-01
|
31
|
2020-07-01
|
32
|
2020-08-01
|
37
|
indicator %>%
ggplot(aes(x = date, y = value)) +
geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
fill = "lightyellow", alpha = 0.02)+
geom_line(color = "red4",size=.8) +
labs(
y = "Thousands of units",
x = "Monthly",
title = "Heavy Weight Truck Sales (HTRUCKSNSA)",
caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
theme_economist()

- All Employees: Durable Goods: Motor Vehicle Manufacturing in Michigan (SMU26000003133610001)
- All Employees: Durable Goods: Motor Vehicle Manufacturing in Alabama (SMU01000003133610001)
- All Employees: Motor Vehicle Manufacturing in Kentucky (SMU21000003133610001)
- All Employees: Motor Vehicle Manufacturing in Texas (SMU48000003133610001)
michigan <-fredr_series_observations(series_id = "SMU26000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(michigan) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Michigan (SMU26000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(michigan$date)} through {max(michigan$date)}"))+
theme_economist()

#-----------------------------
al <-fredr_series_observations(series_id = "SMU01000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(al) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Alabama (SMU01000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(al$date)} through {max(al$date)}"))+
theme_economist()

#-----------------------------
ky <-fredr_series_observations(series_id = "SMU21000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(ky) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Kentucky (SMU21000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(ky$date)} through {max(ky$date)}"))+
theme_economist()

# Texas = SMU48000003133610001
tx <-fredr_series_observations(series_id = "SMU48000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(tx) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Texas (SMU48000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(tx$date)} through {max(tx$date)}"))+
theme_economist()

# California = SMU06000003133610001
ca <-fredr_series_observations(series_id = "SMU06000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(ca) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Califoria (SMU06000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(ca$date)} through {max(ca$date)}"))+
theme_economist()

# Ohio = SMU39000003133610001
oh <-fredr_series_observations(series_id = "SMU39000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(oh) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Ohio (SMU39000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(oh$date)} through {max(oh$date)}"))+
theme_economist()

# Missouri = SMU29000003133610001
mo <-fredr_series_observations(series_id = "SMU29000003133610001",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(mo) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Thousands of workers",
title = "All Employees: Motor Vehicle Manufacturing in Missouri (SMU29000003133610001)",
caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(mo$date)} through {max(mo$date)}"))+
theme_economist()

#-------------------
all <- oh
colnames(all)[3] <-"Ohio"
all$Texas <- tx$value
all$California <- ca$value
all$Kentucky <- ky$value
all$Alabama <- al$value
all$Missouri <- mo$value
Domestic sales of imported new cars, seasonally adjusted and in billions of USD (B149RC1Q027SBEA)
- AB63RC1Q027SBEA Motor vehicle output: Net exports
- Billions of Dollars, Seasonally Adjusted Annual Rate
- Quarterly
import <-fredr_series_observations(series_id = "B149RC1Q027SBEA",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(import) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "Billions of Dollars",
title = "Domestic sales of imported new cars", caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(import$date)} through {max(import$date)}"))+
theme(plot.title = element_text(color="blue", size=14, face="bold"))

#-------
export <-fredr_series_observations(series_id = "AB63RC1Q027SBEA",observation_start = as.Date("2018-01-01"))
# plotting data
ggplot(export) + geom_line(mapping = aes(x=date,y=value), color = "red") +
labs(x = "Time",y = "monthly cars [thousands of units]",
title = "Net Export of Domestic Cars", caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(export$date)} through {max(export$date)}"))+
theme_economist()

Personal consumption expenditures: New autos (A136RC1Q027SBEA)
- Units:Billions of Dollars,Seasonally Adjusted Annual Rate
- Frequency: quarterly
sale <-fredr_series_observations(series_id = "A136RC1Q027SBEA",
observation_start = as.Date("2018-01-01"))
# convert series list to dataframe
sale_df <- do.call(cbind.data.frame, sale)
# plotting data
ggplot(sale_df) + geom_line(mapping = aes(x=date,y=value),
color = "red") +
ggtitle("Personal Expenditures for New Cars") +
labs(x = "Quarterly",y = "Billions of Dollars",
title = "Personal Expenditures for New Cars", caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("From {min(export$date)} through {max(export$date)}"))+
theme_economist()

Personal consumption expenditures: Net purchases of used autos (A137RC1Q027SBEA)
used <-fredr_series_observations(series_id = "A137RC1Q027SBEA",
observation_start = as.Date("2018-01-01"))
# convert series list to dataframe
used_df <- do.call(cbind.data.frame, used)
# plotting data
ggplot(used_df) + geom_line(mapping = aes(x=date,y=value),
color = "red") +
ggtitle("Personal Expenditures for Used Cars") +
xlab("Quarterly") +
ylab("Billions of Dollars")+
theme_economist()
