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: nS0=nL0n⋅l0 nL0=nS0⋅n⋅l0
Other age groups: nSx=nLxnLx−n nLx=nSx⋅nLx−n
Terminal age group: nSx=TxTx−n=∞Lx∞Lx+nLx−n ∞Lx=nSx⋅nLx−n1−nSx
Other survivorship_ratio:
gen_lx_from_nLx_ax()
,
nSx_from_lx_nLx_Tx()