Learn R Programming

BaSTA (version 1.3)

MakeLifeTable: 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 inte
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) t

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 emph{x} and emph{x+n}), emph{Tx} (`person'years lived above age emph{x}), emph{ex} (life expectancy at age emph{x}). }

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

    author{Owen Jones email{jones@mpg.demogr.de}}

    seealso{ code{basta} }

    examples{ MakeLifeTable(rpois(100,3)) }

    keyword{ misc } keyword{ datagen }