Learn R Programming

LifeTables (version 0.1)

lt.mx: Life tables from nmx

Description

Builds a life table by using the mortality rate schedule to calculate the subsequent columns of the table

Usage

lt.mx(nmx, sex="female", age=c(0,1,seq(5,110,5)), nax=NULL)

Arguments

nmx
A vector of age-specific mortality rates
age
The start age of each age interval (will also be the start age for each interval of the subsequent life table)
sex
"male" or "female". The sex determines the nax value for the childhood age intervals using the Coale and Demeney West values when nax=NULL
nax
A set of nax values for the life table. Must have the same length as nmx and if no values of provided, this argument defaults to half the length of the age interval except for the first two childhood age groups.

Value

  • e0Life expectancy at birth
  • ltA life table with age intervals matching those of the nmx schedule on which the table is built and with columns for age, nax, nmx, nqx, npx, ndx, lx, nLx, Tx, and ex.
  • lt.5q0The probability of death between birth and age 5
  • lt.45q15The probability of death between age 15 and 60

Examples

Run this code
# some data to build the table
data(MLTobs)
mx <- mlt.mx[,1]

# build the life table
lt.mx(nmx=mx, sex="male")

Run the code above in your browser using DataLab