View source: R/survivorship_ratio.R
nSx_from_lx_nLx_Tx | R Documentation |
Calculate survivorship ratios to be used in projecting
populations forward in time with ccmpp()
. The survivorship ratios
represent the proportion of people in one age group that will survive into
the next age group given the age-specific mortality rates in a life table.
nSx_from_lx_nLx_Tx(dt, id_cols, terminal_age)
dt |
[ |
id_cols |
[ |
terminal_age |
[ |
See the references page for the formatted equations below.
First age group:
{}_{n}S_0 = \frac{{}_{n}L_{0}}{n \cdot l_0}
Other age groups:
{}_{n}S_x = \frac{{}_{n}L_{x}}{{}_{n}L_{x-n}}
Terminal age group:
{}_{n}S_x = \frac{T_{x}}{T_{x-n}}
[data.table()
] with the id_cols
plus a column for 'nSx' with the
survivorship ratio value.
ccmpp()
Other survivorship_ratio:
gen_lx_from_nLx_ax()
,
gen_nLx_from_nSx()
id_cols <- c("sex", "age_start", "age_end")
dt <- data.table::data.table(
sex = rep("both", 4),
age_start = c(0, 5, 10, 15),
age_end = c(5, 10, 15, Inf),
mx = c(0.1, 0.2, 0.3, 0.4),
ax = c(2.5, 2.5, 2.5, 2.5)
)
lifetable(dt, id_cols)
nSx <- nSx_from_lx_nLx_Tx(dt, id_cols, terminal_age = 15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.