lt_id_ma_q: Calculate conditional death probabilities from nMx and nax

View source: R/lt_id.R

lt_id_ma_qR Documentation

Calculate conditional death probabilities from nMx and nax

Description

Sometimes a given age interval, death rate, and a(x) imply a death probability that is greater than 1. In this case either the interval needs to be extended or a(x) decreased. This especially arises with mid interval a(x) has been assumed in five-year age groups. This backstop reduces a(x) by assuming a constant death rate over the single ages within the interval, assuming mid interval a(x) for each single age, producing nq(x) by identity from the (5) single ages.

Usage

lt_id_ma_q(nMx, nax, AgeInt, closeout = TRUE, IMR)

Arguments

nMx

numeric. Vector of mortality rates in abridged age classes.

nax

numeric. Average time spent in age interval of those that die in the interval.

AgeInt

integer. Vector of age class widths. Default inferAgeIntAbr(Age = Age).

closeout

logical. Set final age to 1 if TRUE. Identity otherwise. Default TRUE.

IMR

numeric. Optional q0 to impute, in case available separately.

Details

nMx equal to 2 will imply nqx of 1 by this formula. Implied nqx greater than 1 after this procedure are returned as 1. This is not vectorized!

Examples

# implies a qx > 1
mx     <- .65
AgeInt <- 5
ax     <- 2.5
# this is a problematic case
 (AgeInt * mx) / (1 + (AgeInt - ax) * mx)
# here a workable value
(lt_id_ma_q(mx, ax, AgeInt, closeout = FALSE))
#' # still less than 1
lt_id_ma_q(1.99, ax, AgeInt, closeout = FALSE) < 1
# unity
(lt_id_ma_q(2, ax, AgeInt, closeout = FALSE))
# qx imputed as 1
(lt_id_ma_q(2.1, ax, AgeInt, closeout = FALSE))

timriffe/DemoTools documentation built on Oct. 14, 2024, 12:53 p.m.