Structure of earnings survey - annual earnings - earn_ses_annual

Data - Eurostat

nace_r2

Code
earn_ses_annual %>%
  left_join(nace_r2, by = "nace_r2") %>%
  group_by(nace_r2, Nace_r2) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
nace_r2 Nace_r2 Nobs
B-N Business economy 1423125
G-N Services of the business economy 1361029
B-F Industry and construction 1341045
B-S_X_O Industry, construction and services (except public administration, defense, compulsory social security) 1260127
P-S Education; human health and social work activities; arts, entertainment and recreation; other service activities 1209438

isco08

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

worktime

Code
earn_ses_annual %>%
  left_join(worktime, by = "worktime") %>%
  group_by(worktime, Worktime) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
worktime Worktime Nobs
FT Full-time 2106972
TOT_FTE Total in full-time equivalents 2077715
PT_FTE Part-time in full-time equivalents 1869481
TOTAL Total 276337
PT Part-time 264259

age

Code
earn_ses_annual %>%
  left_join(age, by = "age") %>%
  group_by(age, Age) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
age Age Nobs
TOTAL Total 1272707
Y_LT30 Less than 30 years 1196967
Y40-49 From 40 to 49 years 826512
Y30-39 From 30 to 39 years 826234
Y50-59 From 50 to 59 years 821845
Y_GE60 60 years or over 789006
Y_GE50 50 years or over 452674
Y30-49 From 30 to 49 years 395283
UNK Unknown 13536

sex

Code
earn_ses_annual %>%
  left_join(sex, by = "sex") %>%
  group_by(sex, Sex) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
sex Sex Nobs
T Total 2237565
M Males 2200809
F Females 2156390

indic_se

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

geo

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

time

Code
earn_ses_annual %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  {if (is_html_output()) print_table(.) else .}
time Nobs
2002 938191
2006 1246147
2010 1307559
2014 1545727
2018 1557140

Table

Javascript

Code
earn_ses_annual %>%
  filter(nace_r2 == "B-N",
         isco08 == "TOTAL",
         worktime == "TOTAL", 
         age == "TOTAL",
         sex == "T",
         indic_se == "MEAN_E_EUR",
         time %in% c("2002", "2014", "2018")) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, time, values) %>%
  na.omit %>%
  mutate(Geo = ifelse(geo == "DE", "Germany", Geo),
         values = round(values)) %>%
  spread(time, values) %>%
  mutate_at(vars(-1, -2), funs(ifelse(is.na(.), "", paste0(., " €")))) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Maps

2018

Code
earn_ses_annual %>%
  filter(nace_r2 == "B-N",
         isco08 == "TOTAL",
         worktime == "TOTAL", 
         age == "TOTAL",
         sex == "T",
         indic_se == "MEAN_E_EUR",
         time %in% c("2018")) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, values) %>%
  right_join(europe_NUTS0, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = values)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = "€"),
                       breaks = seq(0, 100000, 10000),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Avg Wage")