conditional_life_prob {actLifer}R Documentation

Conditional Probability of Survival at Age x

Description

Adds a new column called ConditionalProbLife to the dataset that was input. ConditionalProbLife column contains the probabilities of surviving for each given age group. In other words, this is the probability of someone surviving to their next birthday.

Usage

conditional_life_prob(data, age, pop, deaths)

Arguments

data

The mortality dataset, includes an age grouping variable

age

The age grouping variable, must be cateogrical

pop

Population of each age group, must be numeric

deaths

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

Value

Dataset that was input with added columns ConditionalProbDeath and ConditionalProbLife. In other words, we are doing the "steps" up to the conditional probability of survival.

Examples

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

[Package actLifer version 1.0.0 Index]