Unemployment Rate

black <-fredr_series_observations(series_id = "LNS14000006",
        observation_start = as.Date("2019-01-01")) 
hispanic <-fredr_series_observations(series_id = "LNS14000009",
        observation_start = as.Date("2019-01-01")) 
white <-fredr_series_observations(series_id = "LNS14000003",
        observation_start = as.Date("2019-01-01")) 
asian <-fredr_series_observations(series_id = "LNU04032183",
        observation_start = as.Date("2019-01-01")) 


indicator <-as.data.frame(black$date)

colnames(indicator) <- "date"
indicator$black <- black$value
indicator$hispanic <- hispanic$value
indicator$white <- white$value
indicator$asian <- asian$value



indicator %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "black" ) %>%
  column_spec(3, T, color = "blue") %>%
  column_spec(4, T, color = "green") %>%
   column_spec(5, T, color = "red") 
date black hispanic white asian
2019-01-01 6.9 4.8 3.5 3.2
2019-02-01 7.0 4.3 3.2 3.2
2019-03-01 6.5 4.5 3.3 3.0
2019-04-01 6.6 4.1 3.2 2.1
2019-05-01 6.1 4.1 3.3 2.3
2019-06-01 6.0 4.3 3.3 2.3
2019-07-01 5.6 4.4 3.3 3.0
2019-08-01 5.2 4.2 3.4 2.9
2019-09-01 5.4 4.0 3.2 2.4
2019-10-01 5.6 4.2 3.3 2.8
2019-11-01 5.7 4.3 3.3 2.6
2019-12-01 6.2 4.3 3.1 2.4
2020-01-01 6.1 4.3 3.0 3.2
2020-02-01 6.0 4.4 3.0 2.5
2020-03-01 6.8 6.0 3.9 4.1
2020-04-01 16.7 18.9 14.1 14.3
2020-05-01 16.7 17.6 12.3 14.8
2020-06-01 15.3 14.5 10.1 13.9
2020-07-01 14.4 12.7 9.2 12.2
2020-08-01 12.8 10.5 7.4 10.7
2020-09-01 12.0 10.3 7.0 8.8
2020-10-01 10.8 8.8 6.0 7.5
2020-11-01 10.3 8.4 5.9 6.7
2020-12-01 9.9 9.3 6.0 5.8
library(reshape2)

# Specify id.vars: the variables to keep but not split apart on
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Race","Percent")

# plotting data
data_long %>% ggplot() + 
  geom_line(mapping = aes(x=date,y=Percent,color=Race),size=1)  +
        
   labs(title = "Unemployment rates by demographics", 
       subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
       x="Monthly", y="Percent",
       caption = "Data source: FRED Federal Reserve\nIllustration by @JoeLongSanDiego")+
    theme_economist()

UnEmployment Rates by gender

women <-fredr_series_observations(series_id = "LNU04000002",
        observation_start = as.Date("2019-01-01")) 
men <-fredr_series_observations(series_id = "LNU04000001",
        observation_start = as.Date("2019-01-01")) 



indicator <-as.data.frame(women$date)

colnames(indicator) <- "date"
indicator$women <- women$value
indicator$men <- men$value


indicator %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "black" ) %>%
  column_spec(3, T, color = "blue")
date women men
2019-01-01 4.1 4.7
2019-02-01 3.8 4.4
2019-03-01 3.5 4.3
2019-04-01 3.1 3.6
2019-05-01 3.3 3.4
2019-06-01 4.0 3.7
2019-07-01 4.3 3.7
2019-08-01 4.1 3.5
2019-09-01 3.4 3.3
2019-10-01 3.3 3.3
2019-11-01 3.3 3.3
2019-12-01 3.2 3.5
2020-01-01 3.7 4.2
2020-02-01 3.4 4.1
2020-03-01 4.2 4.8
2020-04-01 15.7 13.3
2020-05-01 14.3 11.9
2020-06-01 12.0 10.5
2020-07-01 11.3 9.7
2020-08-01 9.1 8.0
2020-09-01 8.0 7.3
2020-10-01 6.5 6.6
2020-11-01 6.1 6.6
2020-12-01 6.3 6.7
#---------------------------

# Specify id.vars: the variables to keep but not split apart on
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Gender","Thousands")

# plotting data
data_long %>% ggplot() + 
  geom_line(mapping = aes(x=date,y=Thousands,color=Gender),size=1)  +
        
   labs(title = "Unemployment Rates by Genders", 
       subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
       x="Monthly", y="Percent",
       caption = "Data source: FRED St. Louis Federal Reserve\nIllustration by @JoeLongSanDiego")+
    theme_economist()

Employment Level by gender

women <-fredr_series_observations(series_id = "LNU02000002",
        observation_start = as.Date("2019-01-01")) 
men <-fredr_series_observations(series_id = "LNU02000001",
        observation_start = as.Date("2019-01-01")) 



indicator <-as.data.frame(women$date)

colnames(indicator) <- "date"
indicator$women <- women$value
indicator$men <- men$value


indicator %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "black" ) %>%
  column_spec(3, T, color = "blue")
date women men
2019-01-01 73166 81798
2019-02-01 73857 82311
2019-03-01 73835 82606
2019-04-01 73747 82963
2019-05-01 73591 83561
2019-06-01 73639 84189
2019-07-01 73587 84798
2019-08-01 73740 84077
2019-09-01 74616 83862
2019-10-01 75149 83918
2019-11-01 74971 83973
2019-12-01 75036 83467
2020-01-01 74292 82701
2020-02-01 74970 83047
2020-03-01 73373 81794
2020-04-01 61516 71810
2020-05-01 63457 74004
2020-06-01 66386 76425
2020-07-01 67117 77375
2020-08-01 68513 78711
2020-09-01 68979 78817
2020-10-01 70639 79794
2020-11-01 70913 79291
2020-12-01 70658 78955
#---------------------------

# Specify id.vars: the variables to keep but not split apart on
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Gender","Thousands")

# plotting data
data_long %>% ggplot() + 
  geom_line(mapping = aes(x=date,y=Thousands,color=Gender),size=1)  +
        
   labs(title = "Employment Levels by Gender", 
       subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
       x="Monthly", y="Thousands of Persons",
       caption = "Data source: FRED Federal Reserve.   Illustration by @JoeLongSanDiego")+
    theme_economist()

Unemployment rates by Age brackets

g1 <-fredr_series_observations(series_id = "LNS14000012",
        observation_start = as.Date("2019-01-01")) 
g2 <-fredr_series_observations(series_id = "LNS14000036",
        observation_start = as.Date("2019-01-01")) 
g3 <-fredr_series_observations(series_id = "LNS14000089",
        observation_start = as.Date("2019-01-01")) 
g4 <-fredr_series_observations(series_id = "LNS14000091",
        observation_start = as.Date("2019-01-01")) 
g5 <-fredr_series_observations(series_id = "LNS14000093",
        observation_start = as.Date("2019-01-01")) 
g6 <-fredr_series_observations(series_id = "LNU04000095",
        observation_start = as.Date("2019-01-01")) 


indicator <-as.data.frame(g1$date)

colnames(indicator) <- "date"
indicator$'[16 19]' <- g1$value
indicator$'[20 24]' <- g2$value
indicator$'[25 34]' <- g3$value
indicator$'[35 44]' <- g4$value
indicator$'[45 54]' <- g5$value


indicator %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "black" ) %>%
  column_spec(3, T, color = "blue") %>%
  column_spec(4, T, color = "green") %>%
  column_spec(5, T, color = "darkorange") %>%
  column_spec(6, T, color = "red")
date [16 19] [20 24] [25 34] [35 44] [45 54]
2019-01-01 13 7.5 3.9 2.9 2.9
2019-02-01 14 7.1 4.0 2.6 2.8
2019-03-01 13 7.1 3.9 2.8 2.8
2019-04-01 13 6.6 3.9 2.7 2.6
2019-05-01 12 6.9 3.5 2.7 2.6
2019-06-01 11 5.9 3.5 2.8 2.8
2019-07-01 12 6.5 3.7 2.7 2.6
2019-08-01 12 7.1 3.6 2.8 2.8
2019-09-01 12 6.4 3.5 2.6 2.8
2019-10-01 13 6.4 3.8 2.7 2.6
2019-11-01 12 6.7 3.7 2.8 2.6
2019-12-01 13 6.6 3.7 2.8 2.5
2020-01-01 13 6.6 3.8 2.7 2.4
2020-02-01 12 6.3 3.7 2.7 2.5
2020-03-01 14 8.6 4.2 3.4 3.2
2020-04-01 32 25.6 14.6 11.5 12.3
2020-05-01 30 23.1 13.4 10.1 10.7
2020-06-01 23 19.6 11.7 9.0 8.4
2020-07-01 19 18.1 11.3 8.0 7.8
2020-08-01 16 14.1 9.6 6.4 6.2
2020-09-01 16 12.5 8.6 6.2 6.4
2020-10-01 14 10.9 7.3 5.8 6.0
2020-11-01 14 10.7 7.0 5.6 5.5
2020-12-01 16 11.2 6.6 5.5 5.3
#---------------------------

# Specify id.vars: the variables to keep but not split apart on
data_long <- melt(indicator, id.vars=c("date"))
colnames(data_long) <- c("date","Age_Bracket","Rate")

# plotting data
data_long %>% ggplot() + 
  geom_line(mapping = aes(x=date,y=Rate,color=Age_Bracket),size=1)  +
        
   labs(title = "Unemployment rates by Age brackets", 
       subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}"),
       x="Monthly", y="Rate",
       caption = "Data source: FRED St. Louis Federal Reserve\n Illustration by @JoeLongSanDiego")+
    theme_economist()