Title: | Estimation and Projection of Age-Specific Mortality Rates |
---|---|
Description: | Age-specific mortality rates are estimated and projected using the Kannisto, Lee-Carter and related methods as described in Sevcikova et al. (2016) <doi:10.1007/978-3-319-26603-9_15>. |
Authors: | Hana Sevcikova [cre, aut], Nan Li [aut], Patrick Gerland [aut] |
Maintainer: | Hana Sevcikova <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.8-0 |
Built: | 2025-02-15 02:37:50 UTC |
Source: | https://github.com/cran/MortCast |
Age-specific mortality rates are estimated and projected using the Kannisto, Lee-Carter and related methods as described in Sevcikova et al. (2016) doi:10.1007/978-3-319-26603-9_15.
The package implements methodology described in Sevcikova et al. (2016) that is related to estimating and predicting age-specific mortality rates. The main functions are:
cokannisto
: Extrapolates given mortality rates into higher ages
using the Coherent Kannisto method. The original Kannisto method
(with sex-independent extrapolation) is avalable in the function
kannisto
.
lileecarter.estimate
: Estimates the coherent Lee-Carter parameters
for male and female mortality rates (Li and Lee 2005), i.e. sex-independent parameters and
, and
the coherent parameter
. In addition, it
computes the ultimate
for rotation (Li et al. 2013).
The underlying sex-independent estimation is implemented in the function
leecarter.estimate
.
mortcast
: Using estimated coherent Lee-Carter parameters
and given future sex-specific life expectancies,
it projects age-specific mortality rates, while (by default) rotating the
parameter as described in Li et al. (2013).
Functions contained in the package can be used to apply Algorithm 2 in Sevcikova et al. (2016) as shown in the Example below. It can be used for both, 5-year and 1-year age groups.
Other methods for forecasting mortality rates are available:
pmd
: pattern of mortality decline
mlt
: model life tables
logquad
: log-quadratic mortality model
mortcast.blend
: combining two different methods
A life table can be constructed using the life.table
function.
Hana Sevcikova, Nan Li and Patrick Gerland
Li, N. and Lee, R. D. (2005). Coherent mortality forecasts for a group of populations: An extension of the Lee-Carter method. Demography, 42, 575-594.
Li, N., Lee, R. D. and Gerland, P. (2013). Extending the Lee-Carter method to model the rotation of age patterns of mortality decline for long-term projections. Demography, 50, 2037-2051.
Sevcikova H., Li N., Kantorova V., Gerland P., Raftery A.E. (2016). Age-Specific Mortality and Fertility Rates for Probabilistic Population Projections. In: Schoen R. (eds) Dynamic Demographic Analysis. The Springer Series on Demographic Methods and Population Analysis, vol 39. Springer, Cham. Earlier version.
# This example applies Algorithm 2 in Sevcikova et al. (2016) # on data from WPP2017 for China # data(mxM, mxF, e0Fproj, e0Mproj, package = "wpp2017") country <- "China" # extract observed mortality rates for male and female mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) # Step 1: extrapolate from 100+ to 130+ using Coherent Kannisto mx130 <- cokannisto(mxm, mxf) # Steps 2-5: estimate coherent Lee-Carter parameters # (here ax is computed from the last observed period # and smoothened over ages) lc.est <- lileecarter.estimate(mx130$male, mx130$female, ax.index = ncol(mx130$male), ax.smooth = TRUE) # Steps 6-9: project future mortality rates based on future # life expectancies from WPP2017 e0f <- as.numeric(subset(e0Fproj, name == country)[-(1:2)]) e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) names(e0f) <- names(e0m) <- colnames(e0Fproj)[-(1:2)] pred <- mortcast(e0m, e0f, lc.est) # plot projection for the first and last future time period plot(pred$female$mx[,"2015-2020"], type="l", log="y", ylim=range(pred$female$mx, pred$male$mx), xaxt="n", ylab="mx", xlab="Age", main=country, col="red") axis(1, at=1:nrow(pred$female$mx), labels=rownames(pred$female$mx)) lines(pred$male$mx[,"2015-2020"], col="blue") lines(pred$female$mx[,"2095-2100"], col="red", lty=2) lines(pred$male$mx[,"2095-2100"], col="blue", lty=2) legend("topleft", legend=c("male 2015-2020", "female 2015-2020", "male 2095-2100", "female 2095-2100"), bty="n", col=rep(c("blue", "red"),2), lty=c(1,1,2,2))
# This example applies Algorithm 2 in Sevcikova et al. (2016) # on data from WPP2017 for China # data(mxM, mxF, e0Fproj, e0Mproj, package = "wpp2017") country <- "China" # extract observed mortality rates for male and female mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) # Step 1: extrapolate from 100+ to 130+ using Coherent Kannisto mx130 <- cokannisto(mxm, mxf) # Steps 2-5: estimate coherent Lee-Carter parameters # (here ax is computed from the last observed period # and smoothened over ages) lc.est <- lileecarter.estimate(mx130$male, mx130$female, ax.index = ncol(mx130$male), ax.smooth = TRUE) # Steps 6-9: project future mortality rates based on future # life expectancies from WPP2017 e0f <- as.numeric(subset(e0Fproj, name == country)[-(1:2)]) e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) names(e0f) <- names(e0m) <- colnames(e0Fproj)[-(1:2)] pred <- mortcast(e0m, e0f, lc.est) # plot projection for the first and last future time period plot(pred$female$mx[,"2015-2020"], type="l", log="y", ylim=range(pred$female$mx, pred$male$mx), xaxt="n", ylab="mx", xlab="Age", main=country, col="red") axis(1, at=1:nrow(pred$female$mx), labels=rownames(pred$female$mx)) lines(pred$male$mx[,"2015-2020"], col="blue") lines(pred$female$mx[,"2095-2100"], col="red", lty=2) lines(pred$male$mx[,"2095-2100"], col="blue", lty=2) legend("topleft", legend=c("male 2015-2020", "female 2015-2020", "male 2095-2100", "female 2095-2100"), bty="n", col=rep(c("blue", "red"),2), lty=c(1,1,2,2))
Extrapolate given mortality rates into higher ages using the Coherent Kannisto method as described in Sevcikova et al. (2016).
cokannisto( mxM, mxF, est.ages = seq(80, 95, by = 5), proj.ages = seq(100, 130, by = 5) )
cokannisto( mxM, mxF, est.ages = seq(80, 95, by = 5), proj.ages = seq(100, 130, by = 5) )
mxM |
A vector or matrix of male mortality rates. If it is a matrix, rows correspond to age groups with rownames identifying the corresponding age as integers. By default five-years age groups are assigned to rows if rownames are not given. |
mxF |
A vector or matrix of female mortality rates. Its length or dimension
should be the same |
est.ages |
A vector of integers identifying the ages to be used
for estimation. It should be a subset of rownames of |
proj.ages |
A vector of integers identifying the age groups for which mortality rates
are to be projected. Change the defaults if
1-year age groups are used (see Example in |
The function first estimates the coherent Kannisto parameters
by passing mortality rates for age groups est.ages
into
the cokannisto.estimate
function.
The estimated parameters are then passed to the projection function
kannisto.predict
to extrapolate into ages proj.ages
.
Lastly, the input mortality objects are extended by results for the extrapolated ages.
If proj.ages
contains age groups that are included in mxM
and mxF
,
values for those age groups are overwritten.
A list of two vectors or matrices (for male and female) containing the input motality objects extended by the extrapolated age groups.
Sevcikova H., Li N., Kantorova V., Gerland P., Raftery A.E. (2016). Age-Specific Mortality and Fertility Rates for Probabilistic Population Projections. In: Schoen R. (eds) Dynamic Demographic Analysis. The Springer Series on Demographic Methods and Population Analysis, vol 39. Springer, Cham
cokannisto.estimate
, kannisto.predict
data(mxM, mxF, package = "wpp2017") country <- "South Africa" mxm <- subset(mxM, name == country)[,-(1:3)] mxf <- subset(mxF, name == country)[,-(1:3)] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) mxnew <- cokannisto(mxm, mxf) ages <- as.integer(rownames(mxnew$male)) plot(ages, mxnew$male[,"2095-2100"], type="l", log="y", xlab="age", ylab="mx", col="blue", main=country) lines(ages, mxnew$female[,"2095-2100"], col="red") lines(ages, mxnew$male[,"2010-2015"], lty=2, col="blue") lines(ages, mxnew$female[,"2010-2015"], lty=2, col="red") legend("bottomright", legend=c("male 2010-2015", "female 2010-2015", "male 2095-2100", "female 2095-2100"), bty="n", col=rep(c("blue", "red"),2), lty=c(2,2,1,1))
data(mxM, mxF, package = "wpp2017") country <- "South Africa" mxm <- subset(mxM, name == country)[,-(1:3)] mxf <- subset(mxF, name == country)[,-(1:3)] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) mxnew <- cokannisto(mxm, mxf) ages <- as.integer(rownames(mxnew$male)) plot(ages, mxnew$male[,"2095-2100"], type="l", log="y", xlab="age", ylab="mx", col="blue", main=country) lines(ages, mxnew$female[,"2095-2100"], col="red") lines(ages, mxnew$male[,"2010-2015"], lty=2, col="blue") lines(ages, mxnew$female[,"2010-2015"], lty=2, col="red") legend("bottomright", legend=c("male 2010-2015", "female 2010-2015", "male 2095-2100", "female 2095-2100"), bty="n", col=rep(c("blue", "red"),2), lty=c(2,2,1,1))
Estimate the coherent Kannisto parameters as described in Sevcikova et al. (2016).
cokannisto.estimate(mxM, mxF, ages, fitted = TRUE)
cokannisto.estimate(mxM, mxF, ages, fitted = TRUE)
mxM |
A vector of male mortality rates. |
mxF |
A vector of female mortality rates. |
ages |
A vector of ages corresponding to |
fitted |
Logical. If |
Given the Kannisto equation ,
the Coherent Kannisto method estimates the
parameter jointly for male and female
data, in order to prevent mortality crossovers in higher ages.
List of two lists, one for male and one for female. Each of the two lists contains the following components:
coefficients
:named vector with the coherent Kannisto coefficients and
. The
values are the same in both lists.
fitted.values
:the fitted values (not included if fitted
is FALSE
)
residuals
:input rates minus the fitted values (not included if fitted
is FALSE
)
Sevcikova H., Li N., Kantorova V., Gerland P., Raftery A.E. (2016). Age-Specific Mortality and Fertility Rates for Probabilistic Population Projections. In: Schoen R. (eds) Dynamic Demographic Analysis. The Springer Series on Demographic Methods and Population Analysis, vol 39. Springer, Cham
cokannisto
, kannisto.predict
, kannisto
data(mxM, mxF, package = "wpp2017") country <- "Brazil" mxm <- subset(mxM, name == country)[,"2010-2015"] mxf <- subset(mxF, name == country)[,"2010-2015"] cokannisto.estimate(mxm[18:21], mxf[18:21], ages = 18:21)
data(mxM, mxF, package = "wpp2017") country <- "Brazil" mxm <- subset(mxM, name == country)[,"2010-2015"] mxf <- subset(mxF, name == country)[,"2010-2015"] cokannisto.estimate(mxm[18:21], mxf[18:21], ages = 18:21)
Extrapolate given mortality rates using the original Kannisto method.
kannisto(mx, est.ages = seq(80, 95, by = 5), proj.ages = seq(100, 130, by = 5))
kannisto(mx, est.ages = seq(80, 95, by = 5), proj.ages = seq(100, 130, by = 5))
mx |
A vector or matrix of mortality rates. If it is a matrix, rows correspond to age groups with rownames identifying the corresponding age as integers. By default five-years age groups are assigned to rows if rownames are not given. |
est.ages |
A vector of integers identifying the ages to be used
for estimation. It should be a subset of rownames of |
proj.ages |
A vector of integers identifying the age groups for which mortality rates are to be projected. Change the defaults if 1-year age groups are used (see Example). |
The function first estimates the original Kannisto parameters
by passing mortality rates for age groups est.ages
into
the kannisto.estimate
function.
The estimated parameters are then passed to the projection function
kannisto.predict
to extrapolate into ages proj.ages
.
Lastly, the input mortality object is extended by results for the extrapolated ages.
If proj.ages
contains age groups that are included in mx
,
values for those age groups are overwritten.
A vector or matrix containing the input mortality object mx
extended by the extrapolated age groups.
Thatcher, A. R., Kannisto, V. and Vaupel, J. W. (1998). The Force of Mortality at Ages 80 to 120, volume 5 of Odense Monographs on Population Aging Series. Odense, Denmark: Odense University Press.
kannisto.estimate
, kannisto.predict
, cokannisto
data(mxM, package = "wpp2017") mx <- subset(mxM, name == "Burkina Faso")[,-(1:3)] rownames(mx) <- c(0,1, seq(5, 100, by=5)) mxnew <- kannisto(mx) ages <- as.integer(rownames(mxnew)) plot(ages, mxnew[,"2095-2100"], type="l", log="y", xlab="age", ylab="mx", col="red") lines(ages, mxnew[,"2010-2015"]) # Kannisto for 1-year age groups # derive toy 1-year mx using model life tables at e0 of 70 mx1y <- mlt(70, sex = "male", nx = 1) # Pretend we only observed mx for ages 0:100. # Use 90-99 for estimation and extend mx from 100 to 140 mx1ynew <- kannisto(mx1y[1:100, , drop = FALSE], est.ages = 90:99, proj.ages = 100:140) # Plot the new mx for old ages plot(80:140, mx1ynew[81:141], type = "l", xlab="age", ylab="mx", col="red") # Check how it compares to the original mx that was not used in the estimation lines(100:130, mx1y[101:nrow(mx1y)])
data(mxM, package = "wpp2017") mx <- subset(mxM, name == "Burkina Faso")[,-(1:3)] rownames(mx) <- c(0,1, seq(5, 100, by=5)) mxnew <- kannisto(mx) ages <- as.integer(rownames(mxnew)) plot(ages, mxnew[,"2095-2100"], type="l", log="y", xlab="age", ylab="mx", col="red") lines(ages, mxnew[,"2010-2015"]) # Kannisto for 1-year age groups # derive toy 1-year mx using model life tables at e0 of 70 mx1y <- mlt(70, sex = "male", nx = 1) # Pretend we only observed mx for ages 0:100. # Use 90-99 for estimation and extend mx from 100 to 140 mx1ynew <- kannisto(mx1y[1:100, , drop = FALSE], est.ages = 90:99, proj.ages = 100:140) # Plot the new mx for old ages plot(80:140, mx1ynew[81:141], type = "l", xlab="age", ylab="mx", col="red") # Check how it compares to the original mx that was not used in the estimation lines(100:130, mx1y[101:nrow(mx1y)])
Estimate the Kannisto parameters (Thatcher et al. 1998).
kannisto.estimate(mx, ages)
kannisto.estimate(mx, ages)
mx |
A vector of mortality rates. |
ages |
A vector of ages corresponding to |
Given the Kannisto equation ,
the function estimates the
and
parameters using
values of
ages
as the covariate .
List with the following components:
coefficients
:named vector with Kannisto coefficients and
.
fitted.values
:the fitted values
residuals
:input rates minus the fitted values
Thatcher, A. R., Kannisto, V. and Vaupel, J. W. (1998). The Force of Mortality at Ages 80 to 120, volume 5 of Odense Monographs on Population Aging Series. Odense, Denmark: Odense University Press.
kannisto.predict
, kannisto
, cokannisto.estimate
data(mxM, package = "wpp2017") mx <- subset(mxM, name == "Canada")[,"2010-2015"] kannisto.estimate(mx[18:21], ages = 18:21)
data(mxM, package = "wpp2017") mx <- subset(mxM, name == "Canada")[,"2010-2015"] kannisto.estimate(mx[18:21], ages = 18:21)
Given estimated Kannisto parameters (coherent or original), it predicts mortality rates for given ages.
kannisto.predict(pars, ages)
kannisto.predict(pars, ages)
pars |
A named vector with Kanisto coefficients |
ages |
A vector of ages to make prediction for. These can be indices of age groups or raw ages, but on the same scale as used in the estimation. |
Given parameters and
in
pars
,
the function uses the Kannisto equation ,
to predict mortality rates for age groups
given by
ages
.
Vector of predicted mortality rates.
Thatcher, A. R., Kannisto, V. and Vaupel, J. W. (1998). The Force of Mortality at Ages 80 to 120, volume 5 of Odense Monographs on Population Aging Series. Odense, Denmark: Odense University Press.
cokannisto
, kannisto.estimate
, cokannisto.estimate
data(mxM, mxF, package = "wpp2017") mxm <- subset(mxM, name == "Germany")[,"2010-2015"] ages <- c(0, 1, seq(5, 130, by=5)) # using original Kannisto parameters pars <- kannisto.estimate(mxm[18:21], ages = ages[18:21]) mxm.pred <- kannisto.predict(pars$coefficients, ages = ages[22:28]) plot(ages, c(mxm[1:21], mxm.pred), type="l", log="y", xlab="age", ylab="mx") # Coherent Kannisto mxf <- subset(mxF, name == "Germany")[,"2010-2015"] copars <- cokannisto.estimate( mxm[18:21], mxf[18:21], ages = ages[18:21]) cmxm.pred <- kannisto.predict(copars[["male"]]$coefficients, ages = ages[22:28]) cmxf.pred <- kannisto.predict(copars[["female"]]$coefficients, ages = ages[22:28]) plot(ages, c(mxm[1:21], cmxm.pred), type="l", log="y", xlab="age", ylab="mx", col="blue") lines(ages, c(mxf[1:21], cmxf.pred), col="red")
data(mxM, mxF, package = "wpp2017") mxm <- subset(mxM, name == "Germany")[,"2010-2015"] ages <- c(0, 1, seq(5, 130, by=5)) # using original Kannisto parameters pars <- kannisto.estimate(mxm[18:21], ages = ages[18:21]) mxm.pred <- kannisto.predict(pars$coefficients, ages = ages[22:28]) plot(ages, c(mxm[1:21], mxm.pred), type="l", log="y", xlab="age", ylab="mx") # Coherent Kannisto mxf <- subset(mxF, name == "Germany")[,"2010-2015"] copars <- cokannisto.estimate( mxm[18:21], mxf[18:21], ages = ages[18:21]) cmxm.pred <- kannisto.predict(copars[["male"]]$coefficients, ages = ages[22:28]) cmxf.pred <- kannisto.predict(copars[["female"]]$coefficients, ages = ages[22:28]) plot(ages, c(mxm[1:21], cmxm.pred), type="l", log="y", xlab="age", ylab="mx", col="blue") lines(ages, c(mxf[1:21], cmxf.pred), col="red")
Estimate Lee-Carter parameters (Lee and Carter 1992).
leecarter.estimate( mx, ax.index = NULL, ax.smooth = FALSE, ax.smooth.df = NULL, bx.postprocess = TRUE, nx = 5 )
leecarter.estimate( mx, ax.index = NULL, ax.smooth = FALSE, ax.smooth.df = NULL, bx.postprocess = TRUE, nx = 5 )
mx |
A matrix of age-specific mortality rates where rows correspond to age groups and columns correspond to time periods. Rownames define the starting ages of the age groups. |
ax.index |
A vector of column indices of |
ax.smooth |
Logical allowing to smooth the |
ax.smooth.df |
Degree of freedom for smoothing if |
bx.postprocess |
Logical determining if numerical anomalies in |
nx |
Size of age groups. By default ages are determined by rownames of |
The function estimates parameters of (Lee and Carter 1992).
The argument
ax.index
determines which time periods to use to
estimate the parameter, while
ax.smooth
controls if
the resulting should be smoothened over ages (see Sevcikova et al. 2016 for details).
List with elements ax
, bx
and kt
corresponding to the estimated parameters.
Lee, R. D. and Carter, L. (1992). Modeling and forecasting the time series of US mortality. Journal of the American Statistical Association, 87, 659-671.
Sevcikova H., Li N., Kantorova V., Gerland P., Raftery A.E. (2016). Age-Specific Mortality and Fertility Rates for Probabilistic Population Projections. In: Schoen R. (eds) Dynamic Demographic Analysis. The Springer Series on Demographic Methods and Population Analysis, vol 39. Springer, Cham
mortcast
, lileecarter.estimate
data(mxM, package = "wpp2017") mx <- subset(mxM, name == "Netherlands")[,4:16] rownames(mx) <- c(0,1, seq(5, 100, by=5)) lc.ax.avg <- leecarter.estimate(mx) lc.ax.last <- leecarter.estimate(mx, ax.index=ncol(mx)) plot(lc.ax.avg$ax, type="l") lines(lc.ax.last$ax, col="blue")
data(mxM, package = "wpp2017") mx <- subset(mxM, name == "Netherlands")[,4:16] rownames(mx) <- c(0,1, seq(5, 100, by=5)) lc.ax.avg <- leecarter.estimate(mx) lc.ax.last <- leecarter.estimate(mx, ax.index=ncol(mx)) plot(lc.ax.avg$ax, type="l") lines(lc.ax.last$ax, col="blue")
Function for obtaining life table quantities from mortality rates.
life.table( mx, sex = c("male", "female", "total"), abridged = TRUE, a0rule = c("ak", "cd"), radix = 1, open.age = 130 )
life.table( mx, sex = c("male", "female", "total"), abridged = TRUE, a0rule = c("ak", "cd"), radix = 1, open.age = 130 )
mx |
Vector of age-specific mortality rates nmx. If |
sex |
Which sex the mortality rates correspond to. |
abridged |
Is it an abridged life table ( |
a0rule |
Rule for approximation of a0. "ak" (default) uses the Andreev-Kingkade method (Andreev and Kingkade, 2015), "cd" uses the Coale-Demeany method. |
radix |
Base of the life table. |
open.age |
Open age group. If smaller than the last age group of |
Computes a life table corresponding to given mortality rates for either 5- or 1-year age groups. The implementation follows Preston et al. (2001).
Data frame with rows corresponding to age groups and the following columns:
Starting year of the age group.
Age-specific mortality rates as passed into the mx
argument.
Probability of dying between ages x and x+n.
Number of survivors at age x.
Number of deaths between ages x and x+n.
Person-years lived between ages x and x+n.
Survival rate from age x to x+n. Note that in an abridged life table, sx always refers to 5-year intervals. Here, sx in the first row is the survival from births to the second age group, sx in the second row is the survival from age 0-4 to age 5-9, third row has the survival from 5-9 to 10-14 etc.
Person-years lived after age x.
Life expectancy at age x.
Average person-years lived in the interval by those dying in the interval. For young ages,
it follows Preston et al. (2001), Table 3.3 on page 48. If a0rule
is "ak" (default)
the Andreev-Kingkade method is used for a0.
For compatibility with computations done at the UN, we set ax for ages 5 and 10 in the abridged version
to 2.5. For an unabridged life table, ax is set to 0.5 for all but first and last age groups.
Preston, S.H., Heuveline, P., Guillot, M. (2001). Demography: Measuring and Modeling Population Processes. Oxford: Blackwell Publishers Ltd.
Andreev, E.M. and Kingkade, W.W. (2015). Average age at death in infancy and infant mortality level: Reconsidering the Coale-Demeny formulas at current levels of low mortality. Demographic Research, 33(13), p.363-390. DOI: 10.4054/DemRes.2015.33.13
data(mxF, e0Fproj, package = "wpp2017") # get female mortality of Mexico for the current year country <- "Mexico" mxf <- subset(mxF, name == country)[,"2010-2015"] life.table(mxf, sex = "female")
data(mxF, e0Fproj, package = "wpp2017") # get female mortality of Mexico for the current year country <- "Mexico" mxf <- subset(mxF, name == country)[,"2010-2015"] life.table(mxf, sex = "female")
Estimate coherent Lee-Carter parameters (Li and Lee 2005).
lileecarter.estimate(mxM, mxF, nx = 5, ...)
lileecarter.estimate(mxM, mxF, nx = 5, ...)
mxM |
A matrix of male age-specific mortality rates where rows correspond to age groups and columns correspond to time periods. For 5-year age groups, the first and second rows corresponds to 0-1 and 1-5 age groups, respectively. Rownames define the starting ages of the respective groups. |
mxF |
A matrix of female mortality rates of the same shape as |
nx |
Size of age groups. Should be either 5 or 1. |
... |
Additional arguments passed to |
The coherent Lee-Carter parameters for male and female mortality rates
share the same which is the average of the age-specific
parameters.
The function in addition computes the ultimate as defined in
Li et al. (2013) based on the coherent
.
List containing elements bx
(coherent parameter),
ultimate.bx
(ultimate parameter),
ages
(age groups), nx
(age group interval), and
lists female
and male
, each with the Lee-Carter parameters.
Li, N. and Lee, R. D. (2005). Coherent mortality forecasts for a group of populations: An extension of the Lee-Carter method. Demography, 42, 575-594.
Li, N., Lee, R. D. and Gerland, P. (2013). Extending the Lee-Carter method to model the rotation of age patterns of mortality decline for long-term projections. Demography, 50, 2037-2051.
data(mxM, mxF, package = "wpp2017") country <- "Germany" mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lc <- lileecarter.estimate(mxm, mxf) plot(lc$bx, type="l") lines(lc$ultimate.bx, lty=2)
data(mxM, mxF, package = "wpp2017") country <- "Germany" mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lc <- lileecarter.estimate(mxm, mxf) plot(lc$bx, type="l") lines(lc$ultimate.bx, lty=2)
Predict age-specific mortality rates using the Log-Quadratic Mortality Model (Wilmoth et al. 2012).
logquad( e0, sex = c("male", "female", "total"), my.coefs = NULL, q5ranges = c(1e-04, 0.9), k = 0, keep.lt = FALSE, ... ) logquadj(e0m, e0f, ...)
logquad( e0, sex = c("male", "female", "total"), my.coefs = NULL, q5ranges = c(1e-04, 0.9), k = 0, keep.lt = FALSE, ... ) logquadj(e0m, e0f, ...)
e0 |
Vector of target life expectancies. |
sex |
Which sex does the give |
my.coefs |
Data frame with columns “sex”, “age”, “ax”, “bx”, “cx”, “vx”.
The “sex” column should contain values “female”, “male” and/or “total”.
The “age” column must be sorted so that it assures that rows correspond to ages in increasing order.
Any |
q5ranges |
A vector of size two, giving the min and max of 5q0 used in the bisection method. |
k |
Value of the |
keep.lt |
Logical. If |
... |
Additional arguments passed to the underlying function. |
e0m |
A time series of target male life expectancy. |
e0f |
A time series of target female life expectancy. |
The LogQuad method in this implementation projects mortality rates using the equation
where ,
,
and
are age-specific coefficients,
(i.e. reflects child mortality),
and
should be chosen to match 45q15 (adult mortality) or set to 0 (default). The coefficients
can be passed as inputs, or taken from the package default dataset
LQcoef
which
are taken from https://u.demog.berkeley.edu/~jrw/LogQuad/.
For the given inputs and values of life expectancy e0, the function finds values of that
best match e0, using life tables and the bisection method. It returns the corresponding mortality schedule
for each value of e0.
Function logquad
is for one sex, while logquadj
can be used for both sexes.
Function logquad
returns a list with the following elements: a matrix mx
with the predicted mortality rates. If keep.lt
is TRUE
, it also
contains matrices sr
(survival rates), and life table quantities Lx
and lx
.
Function logquadj
returns a list of objects, one for each sex.
Wilmoth, J., Zureick, S., Canudas-Romo, V., Inoue, M., Sawyer, C. (2012). A Flexible Two-Dimensional Mortality Model for Use in Indirect Estimation. Population studies, 66(1), 1-28. doi:10.1080/00324728.2011.611411
LQcoef
, mortcast.blend
, mortcast
, pmd
, mlt
data(e0Mproj, package = "wpp2017") country <- "Brazil" # get target e0 e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) # project into future pred <- logquad(e0m, sex = "male") # plot first projection in black and the remaining ones in heat colors plot(pred$mx[,1], type = "l", log = "y", ylim = range(pred$mx), ylab = "male mx", xlab = "Age", main = country) for(i in 2:ncol(pred$mx)) lines(pred$mx[,i], col = heat.colors(20)[i])
data(e0Mproj, package = "wpp2017") country <- "Brazil" # get target e0 e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) # project into future pred <- logquad(e0m, sex = "male") # plot first projection in black and the remaining ones in heat colors plot(pred$mx[,1], type = "l", log = "y", ylim = range(pred$mx), ylab = "male mx", xlab = "Age", main = country) for(i in 2:ncol(pred$mx)) lines(pred$mx[,i], col = heat.colors(20)[i])
Data object containing a table of coefficients to be used in the Log-Quadratic Model
as implemented in the logquad
function.
data(LQcoef)
data(LQcoef)
Data frame containing columns “sex”, “age”, “ax”, “bx”, “cx”, “vx”. Rows correspond to sex and age groups.
https://u.demog.berkeley.edu/~jrw/LogQuad/
Wilmoth, J., Zureick, S., Canudas-Romo, V., Inoue, M., Sawyer, C. (2012). A Flexible Two-Dimensional Mortality Model for Use in Indirect Estimation. Population studies, 66(1), 1-28. doi:10.1080/00324728.2011.611411
data(LQcoef) head(LQcoef)
data(LQcoef) head(LQcoef)
Predict age-specific mortality rates using Coale-Demeny and UN model life tables.
mlt(e0, sex = c("male", "female"), type = "CD_West", nx = 5, ...) mltj(e0m, e0f, ..., nx = 5)
mlt(e0, sex = c("male", "female"), type = "CD_West", nx = 5, ...) mltj(e0m, e0f, ..., nx = 5)
e0 |
A time series of target life expectancy. |
sex |
Either "male" or "female". |
type |
Type of the model life table. Available options are “CD_East”, “CD_North”, “CD_South”, “CD_West”, “UN_Chilean”, “UN_Far_Eastern”, “UN_General”, “UN_Latin_American”, “UN_South_Asian”. |
nx |
Size of age groups. Should be either 5 or 1. |
... |
Additional arguments passed to the underlying function. |
e0m |
A time series of target male life expectancy. |
e0f |
A time series of target female life expectancy. |
Given a level of life expectancy (e0), sex and a type of model life table, the function
extracts the corresponding mortality pattern from MLTlookup
(for abridged LT)
or MLT1Ylookup
(for 1-year LT),
while interpolating between neighboring e0 groups.
Function mlt
is for one sex, while mltj
can be used for both sexes.
Function mlt
returns a matrix with the predicted mortality rates. Columns correspond
to the values in the e0
vector and rows correspond to age groups.
Function mltj
returns a list of such matrices, one for each sex.
https://www.un.org/development/desa/pd/data/extended-model-life-tables
Coale, A., P. Demeny, and B. Vaughn. 1983. Regional model life tables and stable populations. 2nd ed. New York: Academic Press.
mortcast
, mortcast.blend
, pmd
, MLTlookup
data(e0Fproj, package = "wpp2017") country <- "Uganda" # get target e0 e0f <- subset(e0Fproj, name == country)[-(1:2)] # project into future using life table Cole-Demeny North mx <- mlt(e0f, sex = "female", type = "CD_North") # plot first projection in black and the remaining ones in grey plot(mx[,1], type = "l", log = "y", ylim = range(mx), ylab = "female mx", xlab = "Age", main = paste(country, "5-year age groups")) for(i in 2:ncol(mx)) lines(mx[,i], col = "grey") # MLT for 1-year age groups mx1y <- mlt(e0f, sex = "female", type = "CD_North", nx = 1) plot(mx1y[,1], type = "l", log = "y", ylim = range(mx1y), ylab = "female mx", xlab = "Age", main = paste(country, "1-year age groups")) for(i in 2:ncol(mx1y)) lines(mx1y[,i], col = "grey")
data(e0Fproj, package = "wpp2017") country <- "Uganda" # get target e0 e0f <- subset(e0Fproj, name == country)[-(1:2)] # project into future using life table Cole-Demeny North mx <- mlt(e0f, sex = "female", type = "CD_North") # plot first projection in black and the remaining ones in grey plot(mx[,1], type = "l", log = "y", ylim = range(mx), ylab = "female mx", xlab = "Age", main = paste(country, "5-year age groups")) for(i in 2:ncol(mx)) lines(mx[,i], col = "grey") # MLT for 1-year age groups mx1y <- mlt(e0f, sex = "female", type = "CD_North", nx = 1) plot(mx1y[,1], type = "l", log = "y", ylim = range(mx1y), ylab = "female mx", xlab = "Age", main = paste(country, "1-year age groups")) for(i in 2:ncol(mx1y)) lines(mx1y[,i], col = "grey")
Lookup tables containing values for various model life tables, including Coale-Demeny and UN life tables.
data(MLTlookup) data(MLT1Ylookup)
data(MLTlookup) data(MLT1Ylookup)
Data frame with the following columns:
Type of the model life table. Available options are “CD_East”, “CD_North”, “CD_South”, “CD_West”, “UN_Chilean”, “UN_Far_Eastern”, “UN_General”, “UN_Latin_American”, “UN_South_Asian”. For the CD types, see Coale et al. (1983). For the UN types, see the link in References below.
Code for distinguishing sexes. 1 is for male, 2 is for female.
Starting age of an age group. In MLTlookup
these are 0, 1, 5, 10, ... 130.
The MLT1Ylookup
table contains 1-year ages ranging from 0 to 130.
Level of life expectancy, starting at 20 and going by steps of 2.5 up to 115.
Mortality rates.
Other life table columns.
An updated version of these datasets were provided by Sara Hertog, United Nations Population Division, in October 2021 (package version >= 2.6-0). For previous version of the tables, install MortCast 2.5-0: 'devtools::install_github("PPgp/[email protected]")'
Coale, A., P. Demeny, and B. Vaughn. 1983. Regional model life tables and stable populations. 2nd ed. New York: Academic Press.
https://www.un.org/development/desa/pd/data/extended-model-life-tables
data(MLTlookup) str(MLTlookup) # CD West life table for male at e0 of 80 subset(MLTlookup, type == "CD_West" & sex == 1 & e0 == 80)
data(MLTlookup) str(MLTlookup) # CD West life table for male at e0 of 80 subset(MLTlookup, type == "CD_West" & sex == 1 & e0 == 80)
Predict age-specific mortality rates using the coherent rotated Lee-Carter method.
mortcast( e0m, e0f, lc.pars, rotate = TRUE, keep.lt = FALSE, constrain.all.ages = FALSE, ... )
mortcast( e0m, e0f, lc.pars, rotate = TRUE, keep.lt = FALSE, constrain.all.ages = FALSE, ... )
e0m |
A time series of future male life expectancy. |
e0f |
A time series of future female life expectancy. |
lc.pars |
A list of coherent Lee-Carter parameters with elements |
rotate |
If |
keep.lt |
Logical. If |
constrain.all.ages |
By default the method constrains the male mortality to be above female
mortality for old ages if the male life expectancy is below the female life expectancy. Setting
this argument to |
... |
Additional life table arguments. |
This function implements Steps 6-9 of Algorithm 2 in Sevcikova et al. (2016). It uses the abridged or unabridged life table function to find the level of mortality that coresponds to the given life expectancy. Thus, it can be used for both, mortality for 5- or 1-year age groups.
List with elements female
and male
, each of which contains a matrix mx
with the predicted mortality rates. If keep.lt
is TRUE
, it also
contains matrices sr
(survival rates), and life table quantities Lx
and lx
.
Li, N., Lee, R. D. and Gerland, P. (2013). Extending the Lee-Carter method to model the rotation of age patterns of mortality decline for long-term projections. Demography, 50, 2037-2051.
Sevcikova H., Li N., Kantorova V., Gerland P., Raftery A.E. (2016). Age-Specific Mortality and Fertility Rates for Probabilistic Population Projections. In: Schoen R. (eds) Dynamic Demographic Analysis. The Springer Series on Demographic Methods and Population Analysis, vol 39. Springer, Cham
rotate.leecarter
, leecarter.estimate
, lileecarter.estimate
,
mortcast.blend
# estimate parameters from historical mortality data (5-year age groups) data(mxM, mxF, e0Fproj, e0Mproj, package = "wpp2017") country <- "Brazil" mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lc <- lileecarter.estimate(mxm, mxf) # project into future for given levels of life expectancy e0f <- as.numeric(subset(e0Fproj, name == country)[-(1:2)]) e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) pred <- mortcast(e0m, e0f, lc) # plot first projection in black and the remaining ones in grey plot(lc$ages, pred$female$mx[,1], type="b", log="y", ylim=range(pred$female$mx), ylab="female mx", xlab="Age", main=paste(country, "(5-year age groups)"), cex=0.5) for(i in 2:ncol(pred$female$mx)) lines(lc$ages, pred$female$mx[,i], col="grey") # similarly for 1-year age groups # derive toy 1-year mx using model life tables at given level of e0 mxm1y <- mlt(seq(65, 71, length = 4), sex = "male", nx = 1) mxf1y <- mlt(seq(73, 78, length = 4), sex = "female", nx = 1) # estimate parameters lc1y <- lileecarter.estimate(mxm1y, mxf1y, nx = 1) # project into the future pred1y <- mortcast(e0m, e0f, lc1y) # plot first projection in black and the remaining ones in grey plot(lc1y$ages, pred1y$female$mx[,1], type="b", log="y", ylim=range(pred1y$female$mx), ylab="female mx", xlab="Age", main="1-year age groups", cex=0.5) for(i in 2:ncol(pred1y$female$mx)) lines(lc1y$ages, pred1y$female$mx[,i], col="grey")
# estimate parameters from historical mortality data (5-year age groups) data(mxM, mxF, e0Fproj, e0Mproj, package = "wpp2017") country <- "Brazil" mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lc <- lileecarter.estimate(mxm, mxf) # project into future for given levels of life expectancy e0f <- as.numeric(subset(e0Fproj, name == country)[-(1:2)]) e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) pred <- mortcast(e0m, e0f, lc) # plot first projection in black and the remaining ones in grey plot(lc$ages, pred$female$mx[,1], type="b", log="y", ylim=range(pred$female$mx), ylab="female mx", xlab="Age", main=paste(country, "(5-year age groups)"), cex=0.5) for(i in 2:ncol(pred$female$mx)) lines(lc$ages, pred$female$mx[,i], col="grey") # similarly for 1-year age groups # derive toy 1-year mx using model life tables at given level of e0 mxm1y <- mlt(seq(65, 71, length = 4), sex = "male", nx = 1) mxf1y <- mlt(seq(73, 78, length = 4), sex = "female", nx = 1) # estimate parameters lc1y <- lileecarter.estimate(mxm1y, mxf1y, nx = 1) # project into the future pred1y <- mortcast(e0m, e0f, lc1y) # plot first projection in black and the remaining ones in grey plot(lc1y$ages, pred1y$female$mx[,1], type="b", log="y", ylim=range(pred1y$female$mx), ylab="female mx", xlab="Age", main="1-year age groups", cex=0.5) for(i in 2:ncol(pred1y$female$mx)) lines(lc1y$ages, pred1y$female$mx[,i], col="grey")
Predict age-specific mortality rates using a blend of two different methods (Coherent Lee-Carter, Coherent Pattern Mortality Decline, Log-Quadratic model, or Model Life Tables). Weights can be applied to fine-tune the blending mix.
mortcast.blend( e0m, e0f, meth1 = "lc", meth2 = "mlt", weights = c(1, 0.5), nx = 5, apply.kannisto = TRUE, min.age.groups = if (nx == 5) 28 else 131, match.e0 = TRUE, keep.lt = FALSE, meth1.args = NULL, meth2.args = NULL, kannisto.args = NULL, ... )
mortcast.blend( e0m, e0f, meth1 = "lc", meth2 = "mlt", weights = c(1, 0.5), nx = 5, apply.kannisto = TRUE, min.age.groups = if (nx == 5) 28 else 131, match.e0 = TRUE, keep.lt = FALSE, meth1.args = NULL, meth2.args = NULL, kannisto.args = NULL, ... )
e0m |
A time series of future male life expectancy. |
e0f |
A time series of future female life expectancy. |
meth1 |
Character string giving the name of the first method to blend. It is one of
“lc”, “pmd”, “mlt” or “logquad”, corresponding to Coherent Lee-Carter (function |
meth2 |
Character string giving the name of the second method to blend.
One of the same choices as |
weights |
Numeric vector with values between 0 and 1 giving the weight of |
nx |
Size of age groups. Should be either 5 or 1. |
apply.kannisto |
Logical. If |
min.age.groups |
Minimum number of age groups. Triggers the application of Kannisto, see above. For a 5-year age groups, the default is 28; for 1-year ages it is 131. |
match.e0 |
Logical. If |
keep.lt |
Logical. If |
meth1.args |
List of arguments passed to the function that corresponds to |
meth2.args |
List of arguments passed to the function that corresponds to |
kannisto.args |
List of arguments passed to the |
... |
Additional life table arguments. |
The function allows to combine two different methods using given weights.
The weights can change over time - by default they are interpolated from the starting weight
to the end weight. As the blended mortality rates do not necessarily match the target life expectancy,
scaling is applied to improve the match, controlled by the match.e0
argument.
The projection is done for both sexes, so that coherent methods can be applied.
List with elements female
and male
, each of which contains a matrix mx
with the predicted mortality rates. If the result has been scaled (match.e0
is TRUE
), the element
mx.rawblend
contains the mx before scaling. Also in such a case, if keep.lt
is TRUE
, it also
contains matrices sr
(survival rates), and life table quantities Lx
and lx
.
In addition, the return object contains elements meth1res
and meth2res
which contain the results of the functions corresponding to the two methods.
Elements meth1
and meth2
contain the names of the methods.
A vector weights
contains the final (possibly interpolated) weights.
mortcast
, copmd
, mltj
, logquad
,
cokannisto
data(mxM, mxF, e0Fproj, e0Mproj, package = "wpp2017") country <- "Brazil" # estimate parameters from historical mortality data mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lcest <- lileecarter.estimate(mxm, mxf) # project into future e0f <- subset(e0Fproj, name == country)[-(1:2)] e0m <- subset(e0Mproj, name == country)[-(1:2)] # Blend LC and MLT pred1 <- mortcast.blend(e0m, e0f, meth1 = "lc", meth2 = "mlt", meth1.args = list(lc.pars = lcest), meth2.args = list(type = "CD_North"), weights = c(1,0.25)) # Blend PMD and MLT pred2 <- mortcast.blend(e0m, e0f, meth1 = "pmd", meth2 = "mlt", meth1.args = list(mxm0 = mxm[, "2010-2015"], mxf0 = mxf[, "2010-2015"])) # plot projection by time plotmx <- function(pred, iage, main) with(pred, { # blended projections plot(female$mx[iage,], type="l", ylim=range(meth1res$female$mx[iage,], meth2res$female$mx[iage,]), ylab="female mx", xlab="Time", main=main, col = "red") lines(meth1res$female$mx[iage,], lty = 2) lines(meth2res$female$mx[iage,], lty = 3) legend("topright", legend=c("blend", meth1, meth2), lty = 1:3, col = c("red", "black", "black"), bty = "n") }) age.group <- 3 # 5-9 years old par(mfrow=c(1,2)) plotmx(pred1, age.group, "LC-MLT (age 5-9)") plotmx(pred2, age.group, "PMD-MLT (age 5-9)") # Blend LC and MLT for 1-year age groups ######################################### # First interpolate e0 to get 1-year life expectancies (for first five years) e0m1y <- approx(as.double(e0m[,1:2]), n = 5)$y e0f1y <- approx(as.double(e0f[,1:2]), n = 5)$y # derive toy mx in order to get some LC parameters mxm1y <- mlt(seq(70, 72, length = 4), sex = "male", nx = 1) mxf1y <- mlt(seq(78, 79, length = 4), sex = "female", nx = 1) lcest1y <- lileecarter.estimate(mxm1y, mxf1y, nx = 1) # projections pred3 <- mortcast.blend(e0m1y, e0f1y, meth1 = "lc", meth2 = "mlt", weights = c(1,0.25), min.age.groups = 131, nx = 1, meth1.args = list(lc.pars = lcest1y), kannisto.args = list(est.ages = 90:99, proj.ages = 100:130)) # plot results par(mfrow=c(1,1)) plot(0:130, pred3$female$mx[,5], log = "y", type = "l", col = "red") lines(0:130, pred3$male$mx[,5], col = "blue")
data(mxM, mxF, e0Fproj, e0Mproj, package = "wpp2017") country <- "Brazil" # estimate parameters from historical mortality data mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lcest <- lileecarter.estimate(mxm, mxf) # project into future e0f <- subset(e0Fproj, name == country)[-(1:2)] e0m <- subset(e0Mproj, name == country)[-(1:2)] # Blend LC and MLT pred1 <- mortcast.blend(e0m, e0f, meth1 = "lc", meth2 = "mlt", meth1.args = list(lc.pars = lcest), meth2.args = list(type = "CD_North"), weights = c(1,0.25)) # Blend PMD and MLT pred2 <- mortcast.blend(e0m, e0f, meth1 = "pmd", meth2 = "mlt", meth1.args = list(mxm0 = mxm[, "2010-2015"], mxf0 = mxf[, "2010-2015"])) # plot projection by time plotmx <- function(pred, iage, main) with(pred, { # blended projections plot(female$mx[iage,], type="l", ylim=range(meth1res$female$mx[iage,], meth2res$female$mx[iage,]), ylab="female mx", xlab="Time", main=main, col = "red") lines(meth1res$female$mx[iage,], lty = 2) lines(meth2res$female$mx[iage,], lty = 3) legend("topright", legend=c("blend", meth1, meth2), lty = 1:3, col = c("red", "black", "black"), bty = "n") }) age.group <- 3 # 5-9 years old par(mfrow=c(1,2)) plotmx(pred1, age.group, "LC-MLT (age 5-9)") plotmx(pred2, age.group, "PMD-MLT (age 5-9)") # Blend LC and MLT for 1-year age groups ######################################### # First interpolate e0 to get 1-year life expectancies (for first five years) e0m1y <- approx(as.double(e0m[,1:2]), n = 5)$y e0f1y <- approx(as.double(e0f[,1:2]), n = 5)$y # derive toy mx in order to get some LC parameters mxm1y <- mlt(seq(70, 72, length = 4), sex = "male", nx = 1) mxf1y <- mlt(seq(78, 79, length = 4), sex = "female", nx = 1) lcest1y <- lileecarter.estimate(mxm1y, mxf1y, nx = 1) # projections pred3 <- mortcast.blend(e0m1y, e0f1y, meth1 = "lc", meth2 = "mlt", weights = c(1,0.25), min.age.groups = 131, nx = 1, meth1.args = list(lc.pars = lcest1y), kannisto.args = list(est.ages = 90:99, proj.ages = 100:130)) # plot results par(mfrow=c(1,1)) plot(0:130, pred3$female$mx[,5], log = "y", type = "l", col = "red") lines(0:130, pred3$male$mx[,5], col = "blue")
Predict age-specific mortality rates using the Pattern of mortality decline (PMD) method (Andreev et al. 2013).
pmd( e0, mx0, sex = c("male", "female"), nx = 5, interp.rho = FALSE, kranges = c(0, 25), keep.lt = FALSE, keep.rho = FALSE, ... ) modpmd( e0, mx0, sex = c("male", "female"), nx = 5, interp.rho = FALSE, kranges = c(0, 25), ax.index = NULL, ax.smooth = FALSE, ax.smooth.df = NULL, keep.lt = FALSE, keep.rho = FALSE, ... ) copmd( e0m, e0f, mxm0, mxf0, nx = 5, interp.rho = FALSE, keep.rho = FALSE, use.modpmd = FALSE, ... )
pmd( e0, mx0, sex = c("male", "female"), nx = 5, interp.rho = FALSE, kranges = c(0, 25), keep.lt = FALSE, keep.rho = FALSE, ... ) modpmd( e0, mx0, sex = c("male", "female"), nx = 5, interp.rho = FALSE, kranges = c(0, 25), ax.index = NULL, ax.smooth = FALSE, ax.smooth.df = NULL, keep.lt = FALSE, keep.rho = FALSE, ... ) copmd( e0m, e0f, mxm0, mxf0, nx = 5, interp.rho = FALSE, keep.rho = FALSE, use.modpmd = FALSE, ... )
e0 |
A vector of target life expectancy, one element for each predicted time point. |
mx0 |
A vector with starting age-specific mortality rates. In case of |
sex |
Either "male" or "female". |
nx |
Size of age groups. Should be either 5 or 1. |
interp.rho |
Logical controlling if the |
kranges |
A vector of size two, giving the min and max of the |
keep.lt |
Logical. If |
keep.rho |
Logical. If |
... |
Additional arguments passed to the underlying functions. For |
ax.index |
A vector of column indices of |
ax.smooth |
Logical allowing to smooth the |
ax.smooth.df |
Degree of freedom for smoothing if |
e0m |
A time series of target male life expectancy. |
e0f |
A time series of target female life expectancy. |
mxm0 , mxf0
|
A vector with starting age-specific male/female mortality rates. If |
use.modpmd |
Logical determining if the modified version of PMD ( |
These functions implements the PMD method introduced in Andreev et al. (2013) and its modifications. It assumes that the future decline in age-specific mortality will follow a certain pattern with the increase in life expectancy at birth (e0):
Here, is the age-specific pattern of mortality decline between
and
. Such patterns for each sex and various levels of e0
are stored in the dataset
PMDrho
. The pmd
function can be instructed
to interpolate between neighboring levels of e0 by setting the argument interp.rho
to TRUE
. The parameter is estimated to match the e0 level using the bisection
method.
Function pmd
evaluates the method for a single sex, while copmd
does it
coherently for both sexes. In the latter case, the same
(namely the average over sex-specific
) is used
for both, male and female.
Function modpmd
implements a modified version of pmd
where the initial
is replaced by an
estimated as in
leecarter.estimate
, i.e. using possibly
multiple years of historical mx
and optionally smoothed. Arguments ax.index
, ax.smooth
and
ax.smooth.df
determine the estimation years and parameters of the smoothing.
Function pmd
and modpmd
return a list with the following elements: a matrix mx
with the predicted mortality rates. If keep.lt
is TRUE
, it also
contains matrices sr
(survival rates), and life table quantities Lx
and lx
.
If keep.rho
is TRUE
, it contains a matrix rho
where columns correspond
to the values in the e0
vector and rows correspond to age groups.
Function copmd
returns a list with one element for each sex
(male
and female
) where each of them is a list as described above.
In addition if keep.rho
is TRUE
, element rho.sex
gives the sex-dependent (i.e. not averaged) coefficient.
Andreev, K., Gu, D., Gerland, P. (2013). Age Patterns of Mortality Improvement by Level of Life Expectancy at Birth with Applications to Mortality Projections. Paper presented at the Annual Meeting of the Population Association of America, New Orleans, LA. https://paa2013.populationassociation.org/papers/132554.
Gu, D., Pelletier, F., Sawyer, C. (2017). Projecting Age-sex-specific Mortality: A Comparison of the Modified Lee-Carter and Pattern of Mortality Decline Methods, UN Population Division, Technical Paper No. 6. New York: United Nations. https://population.un.org/wpp/Publications/Files/WPP2017_TechnicalPaperNo6.pdf
mortcast
, mortcast.blend
, PMDrho
data(mxF, e0Fproj, package = "wpp2017") country <- "Hungary" # get initial mortality for the current year mxf <- subset(mxF, name == country)[,"2010-2015"] names(mxf) <- c(0,1, seq(5, 100, by=5)) # get target e0 e0f <- subset(e0Fproj, name == country)[-(1:2)] # project into future pred <- pmd(e0f, mxf, sex = "female") # plot first projection in black and the remaining ones in grey plot(pred$mx[,1], type = "l", log = "y", ylim = range(pred$mx), ylab = "female mx", xlab = "Age", main = country) for(i in 2:ncol(pred$mx)) lines(pred$mx[,i], col = "grey")
data(mxF, e0Fproj, package = "wpp2017") country <- "Hungary" # get initial mortality for the current year mxf <- subset(mxF, name == country)[,"2010-2015"] names(mxf) <- c(0,1, seq(5, 100, by=5)) # get target e0 e0f <- subset(e0Fproj, name == country)[-(1:2)] # project into future pred <- pmd(e0f, mxf, sex = "female") # plot first projection in black and the remaining ones in grey plot(pred$mx[,1], type = "l", log = "y", ylim = range(pred$mx), ylab = "female mx", xlab = "Age", main = country) for(i in 2:ncol(pred$mx)) lines(pred$mx[,i], col = "grey")
Data object containing a table of coefficients to be used to adjust the sex ratio in the
coherent Pattern Mortality Decline method as implemented in the copmd
function. To invoke
the adjustment, argument sexratio.adjust
should be set to TRUE
.
data(PMDadjcoef)
data(PMDadjcoef)
Data frame containing columns “age”, “intercept”, “lmxf”, “e0f”, “e0f2”, and “gap”. Rows correspond to age groups. The values are estimates of the following regression
The order of the columns starting with intercept corresponds to the order of the coefficients in the above equation.
The coefficients were estimated and provided by Danan Gu, UN Population Division.
Gu, D., Pelletier, F. and Sawyer, C. (2017). Projecting Age-sex-specific Mortality: A Comparison of the Modified Lee-Carter and Pattern of Mortality Decline Methods, UN Population Division, Technical Paper No. 6. New York: United Nations. https://population.un.org/wpp/Publications/Files/WPP2017_TechnicalPaperNo6.pdf
data(PMDadjcoef) PMDadjcoef
data(PMDadjcoef) PMDadjcoef
Data object containing two tables with coefficients for the
Pattern Mortality Decline method as implemented in the
pmd
function.
data(PMDrho)
data(PMDrho)
Using data(PMDrho)
loads two objects into memory: RhoFemales
and
RhoMales
. They both are data frames with 22 rows corresponding to age groups,
and 17 columns corresponding to different levels of life expectancy in 5-years intervals
(from 50 to 135). The names of the columns reflect the middle of the respective interval.
Andreev, K. Gu, D., Gerland, P. (2013). Age Patterns of Mortality Improvement by Level of Life Expectancy at Birth with Applications to Mortality Projections. Paper presented at the Annual Meeting of the Population Association of America, New Orleans, LA. https://paa2013.populationassociation.org/papers/132554.
Gu, D., Pelletier, F. and Sawyer, C. (2017). Projecting Age-sex-specific Mortality: A Comparison of the Modified Lee-Carter and Pattern of Mortality Decline Methods, UN Population Division, Technical Paper No. 6. New York: United Nations. https://population.un.org/wpp/Publications/Files/WPP2017_TechnicalPaperNo6.pdf
data(PMDrho) head(RhoFemales) head(RhoMales) # plot a few male patterns e0lev <- colnames(RhoMales)[c(1, 5, 9, 13, 17)] plot(RhoMales[, e0lev[1]], type="l", log="y", ylim=range(RhoMales[,e0lev]), ylab="male rho", xlab="Age") for(i in 2:length(e0lev)) lines(RhoMales[,e0lev[i]], lty = i) legend("bottomleft", legend = e0lev, lty = 1:length(e0lev), bty= "n")
data(PMDrho) head(RhoFemales) head(RhoMales) # plot a few male patterns e0lev <- colnames(RhoMales)[c(1, 5, 9, 13, 17)] plot(RhoMales[, e0lev[1]], type="l", log="y", ylim=range(RhoMales[,e0lev]), ylab="male rho", xlab="Age") for(i in 2:length(e0lev)) lines(RhoMales[,e0lev[i]], lty = i) legend("bottomleft", legend = e0lev, lty = 1:length(e0lev), bty= "n")
Rotate the Lee-Carter parameter over time to reach an ultimate
,
as described in Li et al. (2013).
rotate.leecarter(bx, ultimate.bx, e0, e0l = 80, e0u = 102, p = 0.5) ultimate.bx(bx)
rotate.leecarter(bx, ultimate.bx, e0, e0l = 80, e0u = 102, p = 0.5) ultimate.bx(bx)
bx |
A vector of the Lee-Carter |
ultimate.bx |
A vector of the ultimate |
e0 |
A time series of life expectancies. |
e0l |
Level of life expectancy at which the rotation starts. |
e0u |
Level of life expectancy at which the rotation finishes. |
p |
Exponent of the smooth function. |
Function rotate.leecarter
returns a matrix of rotated where rows correspond to age groups and columns
correspond to time periods (given by the vector
e0
).
Function ultimate.bx
returns a vector of the ultimate .
Li, N., Lee, R. D. and Gerland, P. (2013). Extending the Lee-Carter method to model the rotation of age patterns of mortality decline for long-term projections. Demography, 50, 2037-2051.
data(mxF, mxM, e0Fproj, e0Mproj, package = "wpp2017") country <- "Japan" mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] e0f <- as.numeric(subset(e0Fproj, name == country)[-(1:2)]) e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lc <- lileecarter.estimate(mxm, mxf) rotlc <- rotate.leecarter(lc$bx, lc$ultimate.bx, (e0f + e0m)/2) plot(lc$bx, type="l") lines(lc$ultimate.bx, col="red") for(i in 1:ncol(rotlc)) lines(rotlc[,i], col="grey")
data(mxF, mxM, e0Fproj, e0Mproj, package = "wpp2017") country <- "Japan" mxm <- subset(mxM, name == country)[,4:16] mxf <- subset(mxF, name == country)[,4:16] e0f <- as.numeric(subset(e0Fproj, name == country)[-(1:2)]) e0m <- as.numeric(subset(e0Mproj, name == country)[-(1:2)]) rownames(mxm) <- rownames(mxf) <- c(0,1, seq(5, 100, by=5)) lc <- lileecarter.estimate(mxm, mxf) rotlc <- rotate.leecarter(lc$bx, lc$ultimate.bx, (e0f + e0m)/2) plot(lc$bx, type="l") lines(lc$ultimate.bx, col="red") for(i in 1:ncol(rotlc)) lines(rotlc[,i], col="grey")