prop_to_survive | R Documentation |
Adds a new column called PropToSurvive to the dataset that was input. PropToSurvive is the proportion surviving to age x
prop_to_survive(data, age, pop, deaths)
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 |
Data frame that was input with columns for steps up to proportion surviving to age x included. That is, the original data with the following added columns: ConditionalProbDeath, ConditionalProbLife, NumberToSurvive, PropToSurvive
# This function will add the ConditionalProbDeath, ConditionalProbLife,
# NumberToSbrvivem and PropToSurvive columns to the dataset
prop_to_survive(mortality2, "age_group", "population", "deaths")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.