Example: Life Expectancy and YLL calculation

  • Life Expectancies
ex2019 <- hmsidwR::gho_lifetables |>
  filter(year == 2019, indicator == "ex") |>
  select(-indicator, -year) |>
  rename(le = value)
  • Calculate YLLs:
YLL_global_stroke <- deaths_stroke |>
  full_join(ex2019) |>
  group_by(age, sex) |>
  mutate(YLL = dx * le) |>
  ungroup()

YLL_global_stroke |> head()