Title: | The Double-Gap Life Expectancy Forecasting Model |
---|---|
Description: | Life expectancy is highly correlated over time among countries and between males and females. These associations can be used to improve forecasts. Here we have implemented a method for forecasting female life expectancy based on analysis of the gap between female life expectancy in a country compared with the record level of female life expectancy in the world. Second, to forecast male life expectancy, the gap between male life expectancy and female life expectancy in a country is analysed. We named this method the Double-Gap model. For a detailed description of the method see Pascariu et al. (2018). <doi:10.1016/j.insmatheco.2017.09.011>. |
Authors: | Marius D. Pascariu [aut, cre] |
Maintainer: | Marius D. Pascariu <[email protected]> |
License: | GPL-3 |
Version: | 1.0.6 |
Built: | 2025-01-28 03:09:00 UTC |
Source: | https://github.com/mpascariu/mortalitygaps |
Fit a Double-Gap model for forecasting life expectancy. The method combines separate forecasts to obtain joint male and female life expectancies that are coherent with a best-practice trend. See the entire description and mathematical formulation of the model in Pascariu et al. (2018)
DoubleGap(DF, DM, age, country, years, arima.order = NULL, drift = NULL, tau = NULL, A = NULL)
DoubleGap(DF, DM, age, country, years, arima.order = NULL, drift = NULL, tau = NULL, A = NULL)
DF |
data.frame containing life expectancy records for females. The table must contain the following 4 columns: country, year, age, ex. |
DM |
data.frame containing life expectancy records for males.
The table must have the same format and dimensions as |
age |
Indicate the age for which the model to be fitted.
Assuming |
country |
Indicate for which country you want to fit the model. The country
name or code must exist in |
years |
Period of time to be used. Type: numeric vector. |
arima.order |
A specification of the the ARIMA model to be used in
fitting the best-practice gap. The ARIMA order is country specific.
The three integer components (p, d, q) are the AR order,
the degree of differencing, and the MA order. Format: numerical vector of length 3.
If |
drift |
Indicate whether the ARIMA model should include a linear drift
term or not. Type: logical value. If |
tau |
The level of female life expectancy at which the sex-gap is
expected to stop widening and to start narrowing. If |
A |
The level of female life expectancy where we assume no further
change in the sex-gap. If |
The output is of class DoubleGap
with the components:
input |
List with arguments provided in input. Saved for convenience. |
call |
An unevaluated function call, that is, an unevaluated expression which consists of the named function applied to the given arguments. |
coefficients |
Estimated coefficients. |
fitted.values |
Fitted values of the selected model. |
observed.values |
Country specific observed values obtained from input data.
This is a |
model.parts |
Object containing detailed results of the fitted model. |
residuals |
Deviance residuals. |
Marius D. Pascariu
Pascariu MD, Canudas-Romo V, Vaupel JW (2018). “The double-gap life expectancy forecasting model.” Insurance: Mathematics and Economics, 78, 339–350. doi:10.1016/j.insmatheco.2017.09.011.
# Input data ------------------------------------ # Collection of life expectancies for female populations exF <- MortalityGaps.data$exF # Life expectancy for male populations exM <- MortalityGaps.data$exM # Example 1 ---------------------------------------------- # Fit DG model at age 0 for Australia using data from 1950 to 2014 M0 <- DoubleGap(DF = exF, DM = exM, age = 0, country = "AUS", years = 1950:2014) M0 summary(M0) ls(M0) # Forecast life expectancy in Australia until 2030 P0 <- predict(M0, h = 16) P0 # Plot the results plot(P0) ## Not run: # Example 2 ---------------------------------------------- # Fit DG model at age 0 for Sweden. Provide details about models. # Reproduce published results in the article. M1 <- DoubleGap(DF = exF, DM = exM, age = 0, country = "SWE", years = 1950:2014, arima.order = c(2, 1, 1), drift = TRUE, tau = 75, A = 86) summary(M1) # Predict model P1 <- predict(M1, h = 36) plot(P1) # Example 3 ---------------------------------------------- # Fit DG model for USA at age 65. M2 <- DoubleGap(DF = exF, DM = exM, age = 65, country = "USA", years = 1950:2014, arima.order = c(0, 1, 0), drift = FALSE, tau = 15, A = 24) summary(M2) # Predict model P2 <- predict(M2, h = 36) plot(P2) ## End(Not run)
# Input data ------------------------------------ # Collection of life expectancies for female populations exF <- MortalityGaps.data$exF # Life expectancy for male populations exM <- MortalityGaps.data$exM # Example 1 ---------------------------------------------- # Fit DG model at age 0 for Australia using data from 1950 to 2014 M0 <- DoubleGap(DF = exF, DM = exM, age = 0, country = "AUS", years = 1950:2014) M0 summary(M0) ls(M0) # Forecast life expectancy in Australia until 2030 P0 <- predict(M0, h = 16) P0 # Plot the results plot(P0) ## Not run: # Example 2 ---------------------------------------------- # Fit DG model at age 0 for Sweden. Provide details about models. # Reproduce published results in the article. M1 <- DoubleGap(DF = exF, DM = exM, age = 0, country = "SWE", years = 1950:2014, arima.order = c(2, 1, 1), drift = TRUE, tau = 75, A = 86) summary(M1) # Predict model P1 <- predict(M1, h = 36) plot(P1) # Example 3 ---------------------------------------------- # Fit DG model for USA at age 65. M2 <- DoubleGap(DF = exF, DM = exM, age = 65, country = "USA", years = 1950:2014, arima.order = c(0, 1, 0), drift = FALSE, tau = 15, A = 24) summary(M2) # Predict model P2 <- predict(M2, h = 36) plot(P2) ## End(Not run)
Life expectancy is highly correlated over time among countries and between males and females. These associations can be used to improve forecasts. Here we have implemented a method for forecasting female life expectancy based on analysis of the gap between female life expectancy in a country compared with the record level of female life expectancy in the world. Second, to forecast male life expectancy, the gap between male life expectancy and female life expectancy in a country is analysed. We named this method the Double-Gap model. For a detailed description of the method see Pascariu et al. (2018). <doi:10.1016/j.insmatheco.2017.09.011>.
To learn more about the package, start with the vignettes:
browseVignettes(package = "MortalityGaps")
Maintainer: Marius D. Pascariu [email protected] (0000-0002-2568-6489)
Human Mortality Database (2017).
“University of California, Berkeley (USA), and Max Planck Institute for Demographic Research (Germany). Data downloaded on 10/06/2017.”
https://www.mortality.org.
Pascariu MD (2018).
MortalityLaws: Parametric Mortality Models, Life Tables and HMD.
R package version 1.6.0, https://github.com/mpascariu/MortalityLaws.
Pascariu MD, Canudas-Romo V, Vaupel JW (2018).
“The double-gap life expectancy forecasting model.”
Insurance: Mathematics and Economics, 78, 339–350.
doi:10.1016/j.insmatheco.2017.09.011.
Useful links:
Report bugs at https://github.com/mpascariu/MortalityGaps/issues
Dataset containing records of life expectancy at birth and at age 65 for female and male populations living in 38 countries between 1950 and 2014. This dataset is used in Pascariu et al. (2018) article. The data is provided in the package for testing purposes and to ensure the reproducibility of the results and figures published in the article. By the time you are using this package, the data might be outdated. Download actual demographic data free of charge from Human Mortality Database (2017). Once a username and a password is created on the website the MortalityLaws R package can be used to extract data directly into your R console.
MortalityGaps.data
MortalityGaps.data
An object of class MortalityGaps.data
of length 2.
Human Mortality Database (2017).
“University of California, Berkeley (USA), and Max Planck Institute for Demographic Research (Germany). Data downloaded on 10/06/2017.”
https://www.mortality.org.
Pascariu MD (2018).
MortalityLaws: Parametric Mortality Models, Life Tables and HMD.
R package version 1.6.0, https://github.com/mpascariu/MortalityLaws.
Pascariu MD, Canudas-Romo V, Vaupel JW (2018).
“The double-gap life expectancy forecasting model.”
Insurance: Mathematics and Economics, 78, 339–350.
doi:10.1016/j.insmatheco.2017.09.011.
Generic Plot Function for Class predict.DoubleGap
## S3 method for class 'predict.DoubleGap' plot(x, show.legend = TRUE, ylim = NULL, asp = 1.8, xlab = "\nYear", ylab = "\nLife Expectancy Level", ...)
## S3 method for class 'predict.DoubleGap' plot(x, show.legend = TRUE, ylim = NULL, asp = 1.8, xlab = "\nYear", ylab = "\nLife Expectancy Level", ...)
x |
An object of class |
show.legend |
Logical. Indicate whether to display the legend or not. Default: TRUE. |
ylim |
Numeric vectors of length 2, giving the x and y coordinates ranges. |
asp |
Numeric, giving the aspect ratio y/x. |
xlab |
A title for the x axis: see |
ylab |
A title for the y axis: see |
... |
Further graphical parameters as in |
Marius D. Pascariu
# Complete examples are provided in help page of the DoubleGap function.
# Complete examples are provided in help page of the DoubleGap function.
DoubleGap
Predict DoubleGap model
## S3 method for class 'DoubleGap' predict(object, h, iter = 500, ci = c(0.8, 0.95), ...)
## S3 method for class 'DoubleGap' predict(object, h, iter = 500, ci = c(0.8, 0.95), ...)
object |
An object of class |
h |
Number of periods for forecasting. |
iter |
Number of iterations. Default: 500 |
ci |
Confidence levels. Default: c(0.8, 0.95) |
... |
Additional arguments affecting the predictions produced. |
A list containing predicted value of best-practice life expectancy, best-practice gap, sex gap, and forecast life expectancy for females and males (together with prediction intervals).
Marius D. Pascariu
# Complete examples are provided in help page of the DoubleGap function.
# Complete examples are provided in help page of the DoubleGap function.