Financial Indicators – Stocks

Data - OECD


Info

source dataset .html .qmd .RData
oecd FIN_IND_FBS 2024-09-11 2024-06-14 2023-09-09

Last

obsTime Nobs
2022 723

INDICATOR

Code
FIN_IND_FBS %>%
  left_join(FIN_IND_FBS_var$INDICATOR, by = "INDICATOR") %>%
  group_by(INDICATOR, Indicator) %>%
  summarise(Nobs = n()) %>%
  print_table_conditional()

LOCATION

Code
FIN_IND_FBS %>%
  left_join(FIN_IND_FBS_var$LOCATION, by = "LOCATION") %>%
  group_by(LOCATION, Location) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Location))),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

Ex 1: Financial Net Worth of households and NPISHs, as a percentage of NDI

Code
FIN_IND_FBS %>%
  filter(INDICATOR %in% c("LBF90S14_S15NDI"), 
         LOCATION %in% c("DNK", "FRA", "USA")) %>%
  left_join(FIN_IND_FBS_var$LOCATION, by = "LOCATION") %>%
  year_to_enddate() %>%
  ggplot() + theme_minimal() +
  geom_line(aes(x = date, y = obsValue/100, color = Location, linetype = Location)) +
  scale_color_manual(values = viridis(5)[1:4]) +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(0, 1000, 50),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("% of NDI") + xlab("")