R/survivorship_ratio.R
gen_nLx_from_nSx.Rd
Generate the nLx life table parameter given survivorship ratios (nSx).
gen_nLx_from_nSx(dt, id_cols)
[data.table()
]
Input data that includes columns for id_cols
and 'nSx'.
[character()
]
Columns that uniquely identify each row
of dt
. Must include 'age_start' and 'age_end'.
dt
with column added for new life table parameter. Modifies
data.tables in place.
See the references page for the formatted equations below.
First age group: $${}_{n}S_0 = \frac{{}_{n}L_{0}}{n \cdot l_0}$$ $${}_{n}L_{0} = {}_{n}S_0 \cdot n \cdot l_0$$
Other age groups: $${}_{n}S_x = \frac{{}_{n}L_{x}}{{}_{n}L_{x-n}}$$ $${}_{n}L_{x} = {}_{n}S_x \cdot {{}_{n}L_{x-n}}$$
Terminal age group: $${}_{n}S_x = \frac{T_{x}}{T_{x-n}} = \frac{{}_{\infty}L_{x}}{{}_{\infty}L_{x} + {}_{n}L_{x - n}}$$ $${}_{\infty}L_{x} = \frac{{}_{n}S_x \cdot {}_{n}L_{x - n}}{1 - {}_{n}S_x}$$
Other survivorship_ratio:
gen_lx_from_nLx_ax()
,
nSx_from_lx_nLx_Tx()