Description Usage Arguments Value Source See Also Examples
View source: R/ExtrapolationMethods.R
Wrapper for Extrapolating Old-Age Human Mortality Data Using Various Mortality Models ("laws")
1 2 3 4 5 6 7 8 9 10 | do_extrapolate(
X,
x_fit,
x_extr,
law = c("kannisto", "kannisto_makeham", "makeham", "gompertz", "ggompertz", "beard",
"beard_makeham", "quadratic"),
verbose = TRUE,
opt.method = "LF2",
...
)
|
X |
Input data. UN format. |
x_fit |
Ages to be considered in estimating the mortality model parameters.
|
x_extr |
Ages for which to extrapolate the death-rates. |
law |
The name of the mortality law/model to be used. The following options are available:
|
verbose |
Logical value. If |
opt.method |
Optimization method to use. Default set to 'LF2'. See
|
... |
Other arguments to be passed on to the
|
A data.frame having the same number of columns as input data. Different numbers of rows. UN format.
The function is based on the methods implemented in the
MortalityLaws
R package.
lt_rule_m_extrapolate
MortalityLaw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Example 1 - abridged data
# Extrapolate old-age mortality data
E <- do_extrapolate(X = DDSQLtools.data$Mx5, # data - UN format
x_fit = c(75, 80, 85, 90), # ages to be used in fitting
x_extr = c(90, 95, 100, 105, 110), # ages for which the extrapolation is applied
law = "kannisto") # the model
E
# Build 2 life table: 1st using the original data and the 2nd using the extended data
LT1 <- do_lifetable(X = DDSQLtools.data$Mx5)
LT2 <- do_lifetable(X = E)
LT1[LT1$IndicatorID == "ex", c("AgeStart", "DataValue")]
LT2[LT2$IndicatorID == "ex", c("AgeStart", "DataValue")]
dim(LT1)
dim(LT2) # note the 2nd life table has few extra rows
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.