Learn R Programming

LEdecomp (version 1.0.4)

sen_chandrasekaran_II: Sensitivity from Chandrasekaran II decomposition

Description

Computes the sensitivity of life expectancy to changes in age-specific mortality rates using the Chandrasekaran II decomposition approach described by Ponnapalli (2005). The sensitivity is obtained by dividing the age-specific contributions (from chandrasekaran_II()) 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 a second set of mortality rates.

Usage

sen_chandrasekaran_II(
  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.

numeric vector of sensitivity of life expectancy to perturbations in mx between mx1 and mx2.

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 give numerically identical results to sen_arriaga_sym(), sen_lopez_ruzicka_sym(), and sen_chandrasekaran_III().

References

Ponnapalli2005LEdecomp

See Also

chandrasekaran_II, sen_arriaga, sen_arriaga_sym

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_chandrasekaran_II(mx1, mx2, age = x)

# Check that multiplying sensitivity by rate difference approximates the decomposition
cc_check <- s * (mx2 - mx1)
cc <- chandrasekaran_II(mx1, mx2, age = x)
# \donttest{
plot(x, cc, type = "l")
lines(x, cc_check, col = "red", lty = 2)
# }

Run the code above in your browser using DataLab