Understanding and Applying the Lee-Carter Model for Mortality Forecasting

Introduction to the Lee-Carter Model

The Lee-Carter model is a parametric method used for forecasting age-specific mortality rates. It was developed by Robert F. Lee and David Tjaldini Carter in 1992 as an extension of the classical cohort component life table approach. The model uses age-specific death rates to estimate the future population distribution, with the ultimate goal of predicting mortality rates.

Understanding the Lee-Carter Model

The basic components of the Lee-Carter model are:

  • Age-specific death rates: These are used as input to the model and represent the expected number of deaths per 1,000 people in a particular age group.
  • Time-varying trend component (βt): This represents a linear trend over time and is used to capture changes in mortality rates due to factors like improvements in healthcare and environmental conditions.
  • Time-invariant cohort effect component (αx): This captures the average death rate for each age group and is independent of time.

Fitting the Lee-Carter Model

The Lee-Carter model can be fitted using various methods, including maximum likelihood estimation. The basic steps involve:

  1. Preparing the data: This includes ensuring that the data is in a suitable format for analysis.
  2. Estimating the parameters: These include the trend component (βt), cohort effect component (αx), and age-specific death rates.

Predicting Mortality Rates

Once the model has been fitted, it can be used to predict mortality rates for future years. This involves:

  1. Simulating the model: The model is simulated for a specified range of years using the estimated parameters.
  2. Generating forecasts: These are generated by applying the estimated age-specific death rates and trend components.

Plotting Predicted Mortality Rates

Plotting predicted mortality rates can be achieved by:

  1. Extracting the relevant data: This includes the predicted mortality rates for each year.
  2. Customizing the plot: The plot can be customized to include various features, such as confidence intervals and raw mortality rates.

Extending the Plot to Include Years 1990-2010

To extend the plot to include years 1990-2010, you can:

  1. Simulate for all years: Simulate the model for all years of interest (1990-2020) instead of only 2011-2020.
  2. Plotting for individual ages: Create separate plots for each age group to display the predicted mortality rates for different age groups.

Code Example

Here is an example code that demonstrates how to extend the plot to include years 1990-2010:

# Load necessary libraries
library("devtools")
library("gnm")
library("forecast")
library("StMoMo")
library("cobs")
library("ftsa")
library("demography")

# Read in the Swedish mortality data
MortalityDataSWE <- read.demogdata("SWE_Mx_1x1.txt", "SWE_Exposures_1x1.txt", type = "mortality", label = "Sweden")

# Prepare the data using the StMoMo package for female mortality series
StMoMoSWE <- StMoMoData(MortalityDataSWE, series = "female")

# Define the LC model with a log-link function
mortalityFunc <- lc(link = "log")

# Define the age and year ranges for fitting the model
fitAges <- 20:90
fitYrs <- 1990:2010
totYrs <- 1990:2020

# Calculate observed death rates
obsDeathRateSWE <- StMoMoSWE$Dxt[as.character(fitAges), as.character(totYrs)] / StMoMoSWE$Ext[as.character(fitAges), as.character(totYrs)]

# Fit the LC model
LCfitSWE <- fit(mortalityFunc, data = StMoMoSWE, ages.fit = fitAges, years.fit = fitYrs)

# Simulate the model to get forecasts for all years
forecastLC <- simulate(LCfitSWE, years = 1990:2020)

# Plot the predicted mortality rates
plot(years = 1990:2020, meanMortalitySelected = forecastLC$rates[, 1], type = "l",
     ylim = range(c(meanMortalitySelected[1990:2010, ], lowerBoundSelected[1990:2010, ], upperBoundSelected[1990:2010, ], rawMortalityRates["20", ]), na.rm = TRUE),
     col = "blue", lwd = 2, main = "Predicted Mortality Rates for Swedish Male Population")

lines(years = 1990:2020, lowerBoundSelected[1990:2010, ], col = "red", lty = 2)
lines(years = 1990:2020, upperBoundSelected[1990:2010, ], col = "red", lty = 2)

if (!is.null(rawMortalityRates)) {
    points(years = 1990:2020, rawMortalityRates["20", ], col = "black", pch = 16)
}

legend("topright", legend = c("Mean Prediction", "5% and 95% Percentiles", "Raw Rates"),
       col = c("blue", "red", "black"), lty = c(1, 2, NA), pch = c(NA, NA, 16), bty = "n")

Discussion

This code demonstrates how to extend the plot to include years 1990-2010 by simulating the model for all years of interest and plotting the predicted mortality rates for each year.


Last modified on 2025-03-18