Fails when the age groups are not unique, contiguous and non-overlapping from "00-04" to a single final open interval, when any column is missing or non-finite, lx increases, Lx or ex is not positive, qx lies outside [0, 1], or the identity mx = dx / Lx fails in a closed interval from age 5 upward (the 0-4 group is built from single-year rates, so its grouped mx need not satisfy it exactly).

validate_abridged_life_table(alt)

Arguments

alt

Output of build_abridged_life_table() for one year.

Value

list(passed = logical, issues = named list of flagged tibbles).

Examples

mx1 <- data.frame(age = 0:4, mx = c(0.004, 0.0003, 0.0002, 0.0002, 0.0002))
start <- seq(0, 100, by = 5)
mx5 <- data.frame(
  age_group = c(sprintf("%02d-%02d", start[-21], start[-21] + 4), "100+"),
  mx = c(0.0011, 0.00004 * exp(0.095 * start[-1]))
)
alt <- build_abridged_life_table(mx1, mx5, "female")
validate_abridged_life_table(alt)$passed
#> [1] TRUE

# A table with a duplicated age group fails
validate_abridged_life_table(alt[c(1:5, 5:21), ])$passed
#> Warning: Abridged life table validation flagged 1 issue category.
#> [1] FALSE