Learn R Programming

LEdecomp (version 1.0.4)

mx_to_e0: calculate life expectancy at birth from mortality rates

Description

We follow the full chain of standard lifetable column calculations to translate mx to ex, then select the first element of ex. If min(age) > 0, then we return remaining life expectancy at the lowest given age.

Usage

mx_to_e0(mx, age, sex = "t", nx = rep(1, length(age)), closeout = TRUE)

Value

numeric scalar of e0

Arguments

mx

numeric vector of the mortality rates (central death rates)

age

integer vector of the lower bound of each age group (currently only single ages supported)

sex

character: Male ("m"), Female ("f"), or Total ("t")

nx

age interval width, assumes 1 by default

closeout

logical. Default TRUE.