Final consumption expenditure of households, 2019 Archive - SNA_TABLE5_ARCHIVE

Data - OECD


Nobs - Javascript

Data Structure

id description
LOCATION Country
TRANSACT Transaction
MEASURE Measure
TIME Year
OBS_VALUE Observation Value
TIME_FORMAT Time Format
OBS_STATUS Observation Status
UNIT Unit
POWERCODE Unit multiplier
REFERENCEPERIOD Reference period

SUBJECT

MEASURE

id label
C Current prices
V Constant prices, national base year
VP Constant prices, previous year prices
VOB Constant prices, OECD base year
VPVOB Constant prices, constant PPPs, OECD base year
DOB Deflator

TIME_FORMAT

id label
P1Y Annual
P1M Monthly
P3M Quarterly
P6M Half-yearly
P1D Daily

Ex 1: Shares of Expenditure by Country

Code
SNA_TABLE5_ARCHIVE %>%
  filter(TRANSACT %in% c("P31CP010", "P31DC", "P31CP040", "P31CP060", "P31CP110"),
         obsTime == "2017",
         MEASURE == "C") %>%
  arrange(LOCATION, TRANSACT) %>%
  select(LOCATION, TRANSACT, obsValue) %>%
  spread(TRANSACT, obsValue) %>%
  group_by(LOCATION) %>%
  summarise(`Food` = (100*P31CP010 / P31DC) %>% round(digits = 1),
            `Housing` = (100*P31CP040 / P31DC) %>% round(digits = 1),
            `Health` = (100*P31CP060 / P31DC) %>% round(digits = 1),
            `Restaurant` = (100*P31CP110 / P31DC) %>% round(digits = 1)) %>%
  na.omit %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Ex 2: Shares of Expenditure by Country

Code
SNA_TABLE5_ARCHIVE %>%
  filter(LOCATION %in% c("FRA", "DEU", "USA", "GBR"),
         obsTime == "2017",
         MEASURE == "C") %>%
  arrange(LOCATION, TRANSACT) %>%
  select(LOCATION, TRANSACT, obsValue) %>%
  left_join(SNA_TABLE5_ARCHIVE_var %>% pluck("TRANSACT"), by = c("TRANSACT" = "id")) %>%
  rename(TRANSACT_desc = label) %>%
  spread(LOCATION, obsValue) %>%
  mutate_at(vars(-1, -2), funs(paste0(round(100*./.[1], 1), " %"))) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}