View source: R/surv_lifetable.r
define_surv_lifetable | R Documentation |
Define a survival distribution based on a life-table containing mortality rates by age and gender.
define_surv_lifetable(
x,
start_age,
percent_male,
output_unit = "years",
age_col = "age",
male_col = "male",
female_col = "female",
dpy = get_dpy(),
percent_female = NULL
)
x |
a data frame with columns for the starting age in each age band, the conditional probability of death at each age for men, and the conditional probability of death at each for women. Default column names are "age", "male", and "female", but can be set via optional arguments. |
start_age |
starting age of the population. |
percent_male |
percent of population that is male. Calculated as 1 - percent_female if not provided. |
output_unit |
optional arguemnt for time unit resulting survival distribution will be defined
in terms of. Valid options are |
age_col |
optional argument to change name of the |
male_col |
optional argument to change name of the |
female_col |
optional argument to change name of the |
dpy |
optional argument specifying the number of days per year used in time unit conversion. This argument will be populated automatically in a heromod model. |
percent_female |
percent of population that is female. Calculated as 1 - percent_male if not provided. |
a surv_lifetable
object.
x <- data.frame(
age = c(0, 1, 2, 3),
male = c(0.011, 0.005, 0.003, 0.002),
female = c(0.010, 0.005, 0.004, 0.002)
)
define_surv_lifetable(x, 1, 0.45)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.