CalcMort {paramDemo} | R Documentation |
Calculating Parametric Age-Specific Mortality and survival.
Description
CalcMort
and CalcSurv
are used to calculate the age-specific mortality and survival functions from different parametric models.
Usage
CalcMort(theta, x, model = "GO", shape = "simple",
checkTheta = TRUE)
CalcSurv(theta, x, 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. |
model |
The underlying mortality model to be used. |
shape |
The overall shape of the model. Values are: |
checkTheta |
Logical to verify that the |
Details
1) Age-specific mortality and survival models:
The function CalcMort
uses parametric functions to calculate age-specific survival, defined as the probability of surviving to a given age. The function follows the conventions from package BaSTA (Colchero and Clark 2012, Colchero et al. 2012, Colchero et al. 2021). The mortality function or hazard rate 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 | \bm{\theta}) = \Pr[X > x] = \exp[-\int_0^x \mu(t | \bm{\theta}) dt],
with the cumulative distribution function F(x | \bm{\theta}) = 1 - S(x | \bm{\theta})
. The probability density function of ages at death is
f(x | \bm{\theta}) = \mu(x | \bm{\theta}) S(x | \bm{\theta}),
for x \geq 0
.
1.1)
Argument
“model
”:
The model
argument allows the user to choose between four basic mortality functions, namely
(a) model =
“EX
”: The exponential model (Cox and Oakes 1974), with constant mortality with age, specified as
\mu_b(x | \bm{\theta}) = b,
where b > 0
, with survival
S_b(x | \bm{\theta}) = \exp[-b x].
(b) model =
“GO
”: The Gompertz mortality model (Gompertz 1925, Pletcher 1999), calculated as
\mu_b(x | \bm{\theta}) = \exp(b_0 + b_1 x),
where -\infty < b_0, b_1 < \infty
, with survival
S_b(x | \bm{\theta}) = \exp\left[\frac{e^{b_0}}{b_1}\left(1 - e^{b_1 x}\right)\right].
(c) model =
“WE
”: The Weibull mortality model (Pinder III et al. 1978) calculated as
\mu_b(x | \bm{\theta}) = b_0 b_1^{b_0} x^{b_0 -1},
where b_0, b_1 > 0
, with survival
S_b(x | \bm{\theta}) = \exp\left[-(b_1 x)^{b_0}\right].
(d) model =
“LO
”: The logistic mortality model (Pletcher 1999), calculated as
\mu_b(x | \bm{\theta}) = \frac{\exp(b_0 + b_1 x)}{1 + b_2 \frac{e^{b_0}}{b_1} \left(e^{b_1 x}-1\right)},
where b_0, b_1, b_2 > 0
, with survival
S_b(x | \bm{\theta}) = \left[1 + b_2 \frac{e^{b_0}}{b_1} \left(e^{b_1 x} - 1\right)\right]^{-1 / b_2}.
1.2)
Argument
“shape
”:
The shape
argument allows the user to extend these models in order to explore more complex mortality shapes.
(a) shape =
“simple
”: (default) Leaves the model as defined above, with mortality given by
\mu(x | \bm{\theta}) = \mu_b(x | \bm{\theta})
and survival
S(x | \bm{\theta}) = S_b(x | \bm{\theta}.
(b) shape =
“Makeham
”: A constant is added to the mortality, such that the mortality is given by
\mu(x | \bm{\theta}) = c + \mu_b(x | \bm{\theta}_1),
where \bm{\theta} = [c, \bm{\theta}_1]
, and with survival
S(x | \bm{\theta}) = e^{-cx} S_b(x | \bm{\theta}_1)
The most common models with this shape is the Gompertz-Makeham model (Gompertz 1825, Makeham 1866).
(c) shape =
“bathtub
”: produces a concave shapes in mortality by adding a declining Gompertz term and a constant parameter to the basic mortality model, where the mortality function is
\mu(x | \bm{\theta}) = \exp(a_0 - a_1 x) + c + \mu_b(x | \bm{\theta}_1),
where a_0 \in \mathbb{R}
, a_1, c \geq 0
and \bm{\theta}_1 \subset \bm{\theta}
are specified based on argument model
, and with survival
S(x | \theta) = \exp\left[\frac{e^{a_0}}{a_1}\left(e^{a_1 x} - 1\right)-cx\right] S_b(x | \theta_1).
The most widely use “bathtub
” shaped model is the Siler mortality model (Siler 1979), which provides considerably good fits to mammalian data. The arguments for the Siler model are:
CalcMort(..., model = "GO", shape = "bathtub", ...)
2) Specifying theta parameters:
Argument theta
requires a numerical vector of parameters. For instance, for a Gompertz model with simple shape and with parameter vector \bm{\theta}^{\top} = [b_0, b_1]
where b_0 = -5
and b_1 = 0.1
, the argument should be specified as
CalcMort(theta = c(b0 = -5, b1 = 0.1), ...)
Note that in this example the parameter names are specified directly, this is required when checkTheta = FALSE
. Although assigning the names to each parameter is not necessary when checkTheta = TRUE
, it is advisable to ensure that the right values are assigned to the right parameter.
If argument checkTheta
is set to TRUE
, then the vector of theta
parameters is verified for consistency with the requirements of the model and shape selected.
Value
CalcMort
and CalcSur
return a vector of class “numeric
” with the hazard rate or cumulative survival values at the specified ages, respectively.
Author(s)
Fernando Colchero fernando_colchero@eva.mpg.de
References
Colchero, F. and J.S. Clark (2012) Bayesian inference on age-specific survival from capture-recapture data for censored and truncated data. Journal of Animal Ecology. 81, 139-149.
Colchero, F., O.R. Jones and M. Rebke. (2012) BaSTA: an R package for Bayesian estimation of age-specific survival from incomplete mark-recapture/recovery data with covariates. Method in Ecology and Evolution. 3, 466-470.
Colchero, F., et al. (2021) The long lives of primates and the "invariant rate of aging" hypothesis. Nature Communications 12:3666
Cox, D. R., and Oakes D. (1984) Analysis of Survival Data. Chapman and Hall, London.
Gompertz, B. (1825) On the nature of the function expressive of the law of human mortality, and on a new mode of determining the value of life contingencies. Philosophical Transactions of the Royal Society of London, 115, 513-583.
Makeham, W. M. On the law of mortality (1866). Journal of the Institute of Actuaries 13, 1-34.
Pinder III, J.E., Wiener, J.G. and Smith, M.H. (1978) The Weibull distribution: a new method of summarizing survivorship data. Ecology, 59, 175-179.
Siler, W. A (1979) competing-risk model for animal mortality. Ecology 60, 750-757.
See Also
CalcSurv
to calculate age-specific survival, CalcFert
to calculate age-specific fertility.
Examples
# Gompertz age specific mortality (default):
mort <- CalcMort(theta = c(b0 = -5, b1 = 0.1), x = 10)
# Siler age specific mortality:
mort <- CalcMort(theta = c(a0 = -1, a1 = 1, c = 0.0001,
b0 = -6, b1 = 0.15), x = 10,
model = "GO", shape = "bathtub")
# Gompertz age specific survival (default):
surv <- CalcSurv(theta = c(b0 = -5, b1 = 0.1), x = 10)
# Siler age specific survival:
surv <- CalcSurv(theta = c(a0 = -1, a1 = 1, c = 0.0001,
b0 = -6, b1 = 0.15), x = 10,
model = "GO", shape = "bathtub")