decompose_by_age: Perform decomposition of age-specific mortality contributions...

View source: R/fun-decompose.R

decompose_by_ageR Documentation

Perform decomposition of age-specific mortality contributions in life expectancy between any two regions/time periods

Description

Decompose the difference in life expectancy (at the smallest available age) of two populations represented by their life tables in a given period of time.

Usage

decompose_by_age(L1, L2)

Arguments

L1

Life table corresponding to the region/time period 1;

L2

Life table corresponding to the region/time period 2;

Value

A numerical vector.

References

...

Examples

# Data
L <- data_gbd2021_lt

# Select Life Table 1 & 2
region1 = "Romania"
region2 = "Mexico"
sex     = "female"
year    = 2021

L1 <- L[L$region == region1 & L$sex == sex & L$period == year, ]
L2 <- L[L$region == region2 & L$sex == sex & L$period == year, ]

# Age decomposition
dec <- decompose_by_age(L1, L2)
dec

plot_decompose(dec)

mpascariu/MortalityCauses documentation built on April 17, 2025, 8:31 p.m.