Learn R Programming

MortalityLaws (version 1.5.0)

LawTable: Compute Life Tables from Parameters of a Mortality Law

Description

Compute Life Tables from Parameters of a Mortality Law

Usage

LawTable(x, par, law, scale.x = FALSE, sex = NULL, lx0 = 1e+05,
  ax = NULL)

Arguments

x

Vector of ages at the beginning of the age interval.

par

The parameters of the mortality model.

law

The name of the mortality law/model to be used. e.g. gompertz, makeham, ... To investigate all the possible options, see availableLaws function.

scale.x

Logical. Scale down "x" vector so that it begins with a small value. Method: new.x = x - min(x) + 1. Default: FALSE.

sex

Sex of the population considered here. Default: NULL. This argument affects the first two values in the life table ax column. If sex is specified the values are computed based on the Coale-Demeny method and are slightly different for males than for females. Options: NULL, male, female, total.

lx0

Radix. Default: 100 000.

ax

Numeric scalar. Subject-time alive in age-interval for those who die in the same interval. If NULL this will be estimated. A common assumption is ax = 0.5, i.e. the deaths occur in the middle of the interval. Default: NULL.

Value

The output is of the "LifeTable" class with the components:

lt

Computed life table;

call

Call in which all of the specified arguments are specified by their full names;

process_date

Time stamp.

Details

The "life table" is also called "mortality table" or "actuarial table". This shows, for each age, what the probability is that a person of that age will die before his or her next birthday, the expectation of life across different age ranges or the survivorship of people from a certain population.

Examples

Run this code
# NOT RUN {
# Example 1 --- Makeham --- 4 tables ----------
x1 = 45:100
L1 = "makeham"
C1 = matrix(c(0.00717, 0.07789, 0.00363,
              0.01018, 0.07229, 0.00001,
              0.00298, 0.09585, 0.00002,
              0.00067, 0.11572, 0.00078), 
              nrow = 4, dimnames = list(1:4, c("A", "B", "C")))

LawTable(x = x1, par = C1, law = L1, scale.x = TRUE)

# Example 2 --- Heligman-Pollard -- 1 table ----
x2 = 0:100
L2 = "HP"
C2 = c(0.00223, 0.01461, 0.12292, 0.00091, 
       2.75201, 29.01877, 0.00002, 1.11411)

LawTable(x = x2, par = C2, law = L2, scale.x = FALSE)
# }

Run the code above in your browser using DataLab