life_expectancy {actLifer}R Documentation

Life Expectancy of Age x

Description

Adds a new column called LifeExpectancy to the dataset that was input. LifeExpectancy is how many more years we expect a person of age x to live beyond their current age.

Usage

life_expectancy(data, age, pop, deaths)

Arguments

data

The mortality dataset, includes an age grouping variable,

age

The age grouping variable, must be categorical

pop

Population of each age group, must be numeric

deaths

The midyear number of deaths at each age group, must be numeric

Value

Dataset that was input with the added columns: ConditionalProbDeath, ConditionalProbLife, NumberToSurvive, PersonYears, TotalYears, and LifeExpectancy.

Examples

# This function will add the ConditionalProbDeath, ConditionalProbLife,
# NumberToSurvive, PropToSurvive, PersonYears, TotalYears, and LifeExpectancy
# columns to the dataset.
# This will be a full lifetable
life_expectancy(mortality2, "age_group", "population", "deaths")

[Package actLifer version 1.0.0 Index]