mx_qx_ax_conversions: Convert between mx, qx, and ax values

mx_qx_ax_conversionsR Documentation

Convert between mx, qx, and ax values

Description

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.

Usage

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)

Arguments

mx

[numeric()]
mx (mortality death rate)

age_length

[numeric()]
The length of the age interval (e.g. 5 for age 5-9)

ax

[numeric()]
ax (average number of years lived in the age interval of those who died)

qx

[numeric()]
qx (probability of death)

Details

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.

Value

[numeric()]
The converted mx, qx, or ax value(s).

See Also

  • Preston Demography textbook

  • vignette("introduction_to_life_tables", package = "demCore")

Examples

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)

ihmeuw-demographics/demCore documentation built on Feb. 24, 2024, 11:05 p.m.