life_expectancy {vital}R Documentation

Compute life expectancy from age-specific mortality rates

Description

Returns remaining life expectancy at a given age (0 by default).

Usage

life_expectancy(.data, from_age = 0, mortality)

Arguments

.data

A vital object including an age variable and a variable containing mortality rates.

from_age

Age at which life expectancy to be calculated. Either a scalar or a vector of ages.

mortality

Variable in .data containing Mortality rates (mx). If omitted, the variable with name mx, Mortality or Rate will be used (not case sensitive).

Value

A vital object with life expectancy in column ex.

Author(s)

Rob J Hyndman

References

Chiang CL. (1984) The life table and its applications. Robert E Krieger Publishing Company: Malabar.

Keyfitz, N, and Caswell, H. (2005) Applied Mathematical Demography, Springer-Verlag: New York.

Preston, S.H., Heuveline, P., and Guillot, M. (2001) Demography: measuring and modeling population processes. Blackwell

See Also

life_table()

Examples

# Compute Victorian life expectancy for females over time
aus_mortality |>
  dplyr::filter(Code == "VIC", Sex == "female") |>
  life_expectancy()

[Package vital version 1.1.0 Index]