View source: R/validate_lifetable.R
check_mx_ax_qx | R Documentation |
Helper function to check a data.table for two of mx, ax, and qx and compute the missing parameter if one is missing.
check_mx_ax_qx(dt)
dt |
[ |
Uses mx_ax_to_qx()
, qx_ax_to_mx()
, or mx_qx_to_ax()
function
to complete the set of three life table parameters.
dt
with input columns plus any of 'mx', 'ax', and 'qx' that is
missing in input. Or, returns error if input has fewer than two of these
parameters.
dt <- data.table::data.table(
age_start = c(0, 1, 5, 10),
age_length = c(1, 4, 5, 5),
mx = c(0.009, 0.0004, 0.00015, 0.00019),
ax = c(0.068, 1.626, 2.5, 2.5)
)
dt <- check_mx_ax_qx(dt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.