ALFS Summary tables - ALFS_SUMTAB

Data - OECD

Code
load_data("oecd/ALFS_SUMTAB_var.RData")
load_data("oecd/ALFS_SUMTAB.RData")

Nobs - Javascript

Code
ALFS_SUMTAB %>%
  left_join(ALFS_SUMTAB_var %>% pluck("SUBJECT"), by = c("SUBJECT" = "id")) %>%
  rename(`SUBJECT Description` = label) %>%
  group_by(SUBJECT, `SUBJECT Description`) %>%
  summarise(nobs = n()) %>%
  arrange(-nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Data Structure

Code
ALFS_SUMTAB_var %>%
  pluck("VAR_DESC") %>%
  {if (is_html_output()) print_table(.) else .}
id description
LOCATION Country
SUBJECT Subject
FREQUENCY Frequency
TIME Time
OBS_VALUE Observation Value
TIME_FORMAT Time Format
OBS_STATUS Observation Status
UNIT Unit
POWERCODE Unit multiplier
REFERENCEPERIOD Reference period

SUBJECT

Code
ALFS_SUMTAB_var %>%
  pluck("SUBJECT") %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

FREQUENCY

Code
ALFS_SUMTAB_var %>%
  pluck("FREQUENCY") %>%
  {if (is_html_output()) print_table(.) else .}
id label
A Annual

TIME_FORMAT

Code
ALFS_SUMTAB_var %>%
  pluck("TIME_FORMAT") %>%
  {if (is_html_output()) print_table(.) else .}
id label
P1Y Annual
P1M Monthly
P3M Quarterly
P6M Half-yearly
P1D Daily

UNIT

Code
ALFS_SUMTAB_var %>%
  pluck("UNIT") %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Ex 1

Code
ALFS_SUMTAB %>%
  # YGTT06L1_ST: Unemployment
  filter(SUBJECT == "YGTT06L1_ST") %>%
  mutate(obsValue = obsValue %>% round()) %>%
  left_join(ALFS_SUMTAB_var$LOCATION, by = c("LOCATION" = "id")) %>%
  group_by(Country = label) %>%
  summarise(year_first = first(obsTime),
            value_first = first(obsValue),
            year_last = last(obsTime),
            value_last = last(obsValue)) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Ex 2

Code
ALFS_SUMTAB %>%
  # YGTT06L1_ST: Unemployment
  # YGTT07L1_ST: Labour Force
  filter(SUBJECT %in% c("YGTT06L1_ST", "YGTT07L1_ST")) %>%
  select(SUBJECT, obsValue, LOCATION, obsTime) %>%
  spread(SUBJECT, obsValue) %>%
  na.omit %>%
  mutate(UNR = (100*YGTT06L1_ST/YGTT07L1_ST) %>% round(1) %>% paste("%")) %>%
  left_join(ALFS_SUMTAB_var$LOCATION, by = c("LOCATION" = "id")) %>%
  group_by(Country = label) %>%
  summarise(year_first = first(obsTime),
            UNR_first = first(UNR),
            year_last = last(obsTime),
            UNR_last = last(UNR)) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}