Distribution of income by different income groups - EU-SILC and ECHP surveys - ilc_di02

Data - Eurostat

incgrp

Code
ilc_di02 %>%
  left_join(incgrp, by = "incgrp") %>%
  group_by(incgrp, Incgrp) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

indic_il

Code
ilc_di02 %>%
  left_join(indic_il, by = "indic_il") %>%
  group_by(indic_il, Indic_il) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
indic_il Indic_il Nobs
MED_E Median equivalised net income 33236
MEI_E Mean equivalised net income 33236

geo

Code
ilc_di02 %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

MD40 / MD70

Code
ilc_di02 %>%
  filter(incgrp %in% c("A_MD40", "A_MD70"),
         geo %in% c("FR", "DE"),
         currency == "EUR",
         indic_il == "MED_E") %>%
  time_to_date %>%
  left_join(geo, by = "geo") %>%
  arrange(date, incgrp, geo, values) %>%
  spread(incgrp, values) %>%
  mutate(D1D10 = A_MD40/A_MD70) %>%
  ggplot() + geom_line(aes(x = date, y = D1D10, color = Geo)) +
  scale_color_manual(values = viridis(4)[1:3]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.25, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = seq(0, 1, 0.01)) +
  ylab("D10/D1") + xlab("")