lifetable {actLifer} | R Documentation |
Lifetable Function
Description
Gives user more control over their lifetable compared to the life_expectancy() function. Allows the user to add in the central death rate and proportion surviving to age x. Allows the user to omit accessory columns which are used to calculate life expectancy.
Usage
lifetable(
data,
age,
pop,
deaths,
includeAllSteps = TRUE,
includeCDR = TRUE,
includePS = TRUE,
...
)
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 |
includeAllSteps |
If false, will only include the proportion surviving to age x and life expectancy for age x |
includeCDR |
If true, will include the central death rate for each age group |
includePS |
If true, will include the proportion surviving for each age group |
... |
Other optional grouping variables (can be race, gender, etc.) |
Value
Lifetable
Examples
# Running lifetable() and choosing not to include CentralDeathRate and
# ProportionToSurvive (optional columns) in the output dataset
lifetable(mortality2, "age_group", "population", "deaths", FALSE, TRUE, TRUE)