Learn R Programming

LEdecomp (version 1.0.4)

mx_to_ex: calculate remaining life expectancy from mortality rates

Description

We follow the full chain of standard lifetable column calculations to translate mx to ex.

Usage

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

Value

numeric vector of ex, the same length as mx

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)

nx

age interval width, assumes 1 by default

sex

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

closeout

logical. Default TRUE.