Learn R Programming

LEdecomp (version 1.0.4)

sen_chandrasekaran_III: Sensitivity from Chandrasekaran III decomposition

Description

Computes the implied sensitivity of life expectancy to changes in age-specific mortality rates using the Chandrasekaran III decomposition approach described by Ponnapalli (2005). The sensitivity is obtained by dividing the age-specific contributions (from chandrasekaran_III()) 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_III(
  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 gives numerically identical results to sen_arriaga_sym(), sen_lopez_ruzicka_sym(), and sen_chandrasekaran_II().

References

Ponnapalli2005LEdecomp

See Also

chandrasekaran_III, sen_chandrasekaran_II, sen_arriaga_sym, sen_lopez_ruzicka_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_III(mx1, mx2, age = x)

# Check that multiplying sensitivity by rate difference approximates the decomposition
cc_check <- s * (mx2 - mx1)
cc <- chandrasekaran_III(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