mx_qx_ax_conversions | R Documentation |
Convert between mx and qx values given the length of an age interval. If ax (the average number of years lived in the x to x + n age interval by those dying in the interval) exists, use the ax_to functions. The mx_to_qx and qx_to_mx functions assume smooth mortality across the interval.
mx_to_qx(mx, age_length)
mx_ax_to_qx(mx, ax, age_length)
qx_to_mx(qx, age_length)
mx_qx_to_ax(mx, qx, age_length)
qx_ax_to_mx(qx, ax, age_length)
mx_to_ax(mx, age_length)
mx |
[ |
age_length |
[ |
ax |
[ |
qx |
[ |
mx_to_qx: qx = 1 - exp((-1 * age_length) * mx)
mx_ax_to_qx: qx = (age_length * mx) / (1 + (age_length - ax) * mx)
qx_to_mx: mx = log(1 - qx) / (-1 * age_length)
mx_qx_to_ax: ax = (qx + (mx * age_length * (qx - 1))) / (mx * qx)
qx_ax_to_mx: mx = qx / (age_length - (age_length * qx) + (ax * qx))
mx_to_ax: ax = age_length + (1 / mx) - age_length / (1 - exp(- age_length * mx))
For all functions calculating qx, if age_length = Inf return qx = 1. For all functions computing mx or ax, if age_length = Inf modify age_length to arbitrarily large value (200) to get real number result.
[numeric()
]
The converted mx, qx, or ax value(s).
Preston Demography textbook
vignette("introduction_to_life_tables", package = "demCore")
mx_to_qx(0.25, 45)
mx_ax_to_qx(0.2, 3, 5)
qx_to_mx(0.5, 5)
mx_qx_to_ax(0.005, 0.0247, 5)
qx_ax_to_mx(0.1, 3, 5)
mx_to_ax(0.2, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.