CalcRemainLifeExp {paramDemo} | R Documentation |
Calculating Remaining Life Expectancy.
Description
CalcRemainingLifeExp
calculates remaining life expectancy from parametric models of age-specific mortality.
Usage
CalcRemainLifeExp (theta, x = NULL, dx = NULL, xmax = NULL,
atAllAges = FALSE, model = "GO",
shape = "simple", checkTheta = TRUE)
Arguments
theta |
Numerical vector of age-specific mortality parameters (see details). |
x |
Numerical vector of ages at which to calculate mortality. |
dx |
Numerical value for the width of age intervals used for integration. If |
xmax |
Numerical value for the maximum age. If |
atAllAges |
Logical to indicate whether ageing rates should be provided between ages 0 and |
model |
The underlying mortality model to be used. |
shape |
The overall shape of the model. Values are: |
checkTheta |
Logical to verify that the |
Details
The function CalcAgeingRate
uses parametric functions to calculate the actuarial (i.e., survival) rate of ageing. The function follows the conventions from package BaSTA (Colchero and Clark 2012, Colchero et al. 2012, Colchero et al. 2021) to select the parametric model of mortality. The mortality function describes how the risk of mortality changes with age, and is defined as
\mu(x | \theta) = \lim_{\Delta x \rightarrow 0} \frac{\Pr[x < X < x + \Delta x | X > x]}{\Delta x},
where X
is a random variable for ages at death, x \geq 0
are ages and \theta
is the vector of mortality parameters. From the mortality function, the survival function is then given by
S(x | \theta) = \exp[-\int_0^x \mu(t | \theta) dt].
(For further details on the mortality and survival models see CalcMort
).
Given a vector of ages x_1, x_2, \dots, x_n
specified by the user with argument x
, the function calculates the remaining life expectancy at age x_i
as
e_{x_i} = \frac{\int_{x_i}^{\infty} S(t) dt}{S(x_i)}
for i = 1, 2, \dots, n
.
Value
The function outputs a matrix with the ages from which remaining life expectancies were calculated, and the values for the remaining life expectancy.
Author(s)
Fernando Colchero fernando_colchero@eva.mpg.de
See Also
CalcSurv
to calculate age-specific survival, CalcMort
to calculate age-specific mortality, CalcFert
to calculate age-specific fertility.
CalcAgeMaxFert
to calculate the age at maximum fertility from parametric models of age-specific fertility. CalcAgeingRateMort
to calculate ageing rates from parametric models of age-specific mortality.
Examples
# Calculate ageing rate from Gompertz model:
rle <- CalcRemainLifeExp(theta = c(b0 = -5, b1 = 0.1), x = 10)
# Calculate ageing rate from Siler model:
rle <- CalcRemainLifeExp(theta = c(a0 = -1, a1 = 1, c = 0.0001,
b0 = -6, b1 = 0.15), x = 10,
model = "GO", shape = "bathtub")