Learn R Programming

poputils (version 0.4.1)

q0_to_m0: Convert q0 to m0

Description

Convert the probability of dying during infancy (q0) to the mortality rate for infancy (m0).

Usage

q0_to_m0(
  q0,
  sex = NULL,
  a0 = NULL,
  infant = c("constant", "linear", "CD", "AK")
)

Value

A numeric vector or rvec.

Arguments

q0

Probability of dying in first year of life. A numeric vector or an rvec.

sex

Biological sex. A vector the same length as q0, with labels that can be interpreted by reformat_sex(). Needed only when infant is "CD" or "AK".

a0

Average age at death for infants who die. Optional. See help for lifetab().

infant

Calculation method. See help for lifetab(). Default is "constant".

Warning

The term "infant mortality rate" is ambiguous. Demographers sometimes use it to refer to m0 (which is an actual rate) and sometimes use it to refer to q0 (which is a probability.)

See Also

  • lifetab() Calculate a full life table.

Examples

Run this code
library(dplyr, warn.conflicts = FALSE)
west_lifetab |>
 filter(age == 0, level <= 5) |>
 select(level, sex, age, mx, qx) |>
 mutate(m0 = q0_to_m0(q0 = qx, sex = sex, infant = "CD"))

Run the code above in your browser using DataLab