Learn R Programming

LEdecomp (version 1.0.4)

sen_lopez_ruzicka_sym: Sensitivity from symmetric Lopez-Ruzicka decomposition

Description

Computes the sensitivity of life expectancy to changes in age-specific mortality rates using the symmetric version of the Lopez-Ruzicka decomposition, as described by Ponnapalli (2005). The sensitivity is obtained by dividing the symmetric decomposition result by the differences in mortality rates (mx2 - mx1). This yields a pointwise estimate of the derivative of life expectancy with respect to each age-specific mortality rate evaluated at an imagined midpoint between the first and second set of mortality rates.

Usage

sen_lopez_ruzicka_sym(
  mx1,
  mx2,
  age = (1:length(mx1)) - 1,
  nx = rep(1, length(mx1)),
  sex1 = "t",
  sex2 = sex1,
  closeout = TRUE
)

Value

A numeric vector of sensitivity values by age group.

Arguments

mx1

numeric vector of the mortality rates (central death rates) for population 1

mx2

numeric vector of the mortality rates (central death rates) for population 2

age

integer vector of the lower bound of each age group (currently only single ages supported)

nx

integer vector of age intervals, default 1.

sex1

character either the sex for population 1: Male ("m"), Female ("f"), or Total ("t")

sex2

character either the sex for population 2: Male ("m"), Female ("f"), or Total ("t") assumed same as sex1 unless otherwise specified.

closeout

logical. Default TRUE. Shall we use the HMD Method Protocol to close out the ax and qx values? See details.

Details

This method gives numerically identical results to sen_arriaga_sym(), sen_chandrasekaran_II(), and sen_chandrasekaran_III().

References

Ponnapalli2005LEdecomp

See Also

lopez_ruzicka_sym, sen_arriaga_sym, sen_chandrasekaran_II, sen_chandrasekaran_III

Examples

Run this code
a <- 0.001
b <- 0.07
x <- 0:100
mx1 <- a * exp(x * b)
mx2 <- a/2 * exp(x * b)
s <- sen_lopez_ruzicka_sym(mx1, mx2, age = x)

# Check equivalence with symmetric Arriaga
s2 <- sen_arriaga_sym(mx1, mx2, age = x)
all.equal(s, s2)

Run the code above in your browser using DataLab