MakeLifeTable: A function for calculating standard cohort-based life tables...

View source: R/MakeLifeTable.R

MakeLifeTableR Documentation

A function for calculating standard cohort-based life tables from age at death data.

Description

This function calculates a standard cohort-based life table from death ages.

Usage

MakeLifeTable(DeathAges, ax = 0.5, n = 1)

Arguments

DeathAges

A vector of ages at death. These can be precise (e.g. 5.4 yrs) or rounded to the integer year (e.g. 5 yrs).

ax

A vector describing the average proportion of the interval lived by those dying in the interval. Note that this is slightly different from convention, which defines ax as the average length of time lived in the interval by those dying in the interval. This is so we can cope automatically with varying interval sizes. Further note that the ax in the life table produced by this code is expressed in units of time, rather than proportion of the interval. It is only necessary to put the first few values - further values are extrapolated to the correct dimensions. e.g. if ax is set as c(0.3, 0.5) and there are 5 rows in the life tables, ax will become c(0.3, 0.5, 0.5, 0.5, 0.5).

n

Defines the interval width. The default is 1 (yr), but it can be set to be any numerical value(s). For example, if you want small intervals for early ages, and larger intervals for older ages, you can define n as a sequence such as c(1,1,5) to indicate that the first 2 intervals are 1 year long, then the rest of the intervals are 5 years long.

Value

The function returns a data.frame in the form of a life table with the following column headings. Start and end of the interval, where start of the interval is defined as x, lx (number alive at age x (i.e. at the start of the interval)), nx the size of the interval, dx (number dying between ages x and x+n), mx (death rate in the cohort between ages x and x+n), ax (average time lived in the interval by those dying in the interval), qx (probability of dying between ages x and x+n), px (probability of surviving between ages x and x+n), Lx (‘person’ years lived between ages x and x+n), Tx (‘person’ years lived above age x), ex (life expectancy at age x).

Author(s)

Owen Jones jones@biology.sdu.dk

References

Preston, S.H., Heuveline, P. and Guillot, M. (2001) Demography: Measuring and modeling population processes. Blackwell Publishers, Oxford, UK.

See Also

basta

Examples

MakeLifeTable(rpois(100,3))

BaSTA documentation built on Oct. 5, 2022, 5:06 p.m.