number_to_survive {actLifer}R Documentation

The Number of People to Survive to Age x

Description

Adds a new column called NumberToSurvive to the dataset that was input. NumberToSurvive represents the number of people living at the beginning of the given age interval, using an arbitrary 100,000 people for the first age group in the table.

Usage

number_to_survive(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 added columns: ConditionalProbDeath, ConditionalProbLife, and NumberToSurvive.

Examples

# This function will add the ConditionalProbDeath, ConditionalProbLife, and
# NumberToSurvive columns to the dataset
number_to_survive(mortality2, "age_group", "population", "deaths")

[Package actLifer version 1.0.0 Index]