tipsna62 %>%
filter(geo %in% c("DE"),
unit == "THS_PER") %>%
select(geo, time, emp = values) %>%
left_join(tipslm13 %>%
select(geo, time, comp = values),
by = c("geo", "time")) %>%
left_join(une_rt_a %>%
filter(age == "Y20-64",
sex == "T",
unit == "PC_ACT") %>%
select(geo, time, unr = values),
by = c("geo", "time")) %>%
mutate(comp_emp = comp/emp,
comp_emp_d1 = comp_emp/lag(comp_emp, 1)-1) %>%
year_to_enddate %>%
transmute(date, comp_emp_d1=100*comp_emp_d1, unr = unr) %>%
gather(variable, value, -date) %>%
mutate(Variable = case_when(variable == "comp_emp_d1" ~ "Wage Inflation (%)",
variable == "unr" ~ "Unemployment Rate (%)")) %>%
ggplot + geom_line() + theme_minimal() +
aes(x = date, y = value/100, color = Variable, linetype = Variable) +
scale_color_manual(values = viridis(3)[1:2]) +
scale_x_date(breaks = as.Date(paste0(seq(1960, 2020, 1), "-01-01")),
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 100, 1),
labels = percent_format(accuracy = 1)) +
theme(legend.position = c(0.8, 0.85),
legend.title = element_blank()) +
xlab("") + ylab("Unemployment Rate, Wage Inflation (%)")