The UN a(x) formula uses CoaleDemeny for ages 0, and 14, values of 2.5 for ages 59 and 1014, and the Greville formula for higher ages. In the original sources these are referred to as separation factors.
lt_a_un( nMx, nqx, lx, IMR = NA, Age, AgeInt, a0rule = "ak", Sex = "m", region = "w", SRB = 1.05, tol = .Machine$double.eps, maxit = 1000, mod = TRUE, extrapLaw = "kannisto", extrapFrom = max(Age), extrapFit = Age[Age >= 60], ... )
nMx  numeric. Event exposure mortality rates. 

nqx  numeric. Vector of age specific death probabilities in standard abridged age groups. 
lx  numeric. Vector of lifetable survivorship in standard abridged age groups. 
IMR  numeric. Optional. q_{0}, the death probability in first year of life, in case available separately. 
Age  integer. A vector of ages of the lower integer bound of the age classes. 
AgeInt  integer. Vector of age interval widths. 
a0rule  character. Either 
Sex  character. 
region  character. 
SRB  numeric. The sex ratio at birth (boys/girls), default 1.05. 
tol  numeric. The tolerance for the qxbased iterative method. Default 
maxit  integer. The maximum number of iterations for the qxbased iterative method. Default 1000. 
mod  logical. Whether or not to use Gerland's modification for ages 514. Default 
extrapLaw  character. If extrapolating, which parametric mortality law should be invoked? Options include 
extrapFrom  integer. Age from which to impute extrapolated mortality. 
extrapFit  integer vector. Ages to include in model fitting. Defaults to all ages 
...  Other arguments to be passed on to the

nax average contribution to exposure of those dying in the interval.
a(x) for age 0 and age group 14 are based on CoaleDemeny q_{0}based lookup tables. If the main input is nMx
, and if IMR
is not given, we first approximate q_{0} for the CoaleDemeny approach before applying the formula. The final a(x) value is closed out using the lt_a_closeout()
method (reciprocal and Mortpak methods are deprecated). For nMx inputs this method is rather direct, but for q_{X} or l(x) inputs it is iterative. Age groups must be standard abridged. No check on age groups are done.
Greville TN (1977). “Short methods of constructing abridged life tables.” In Mathematical Demography, 5360. Springer. United Nations (1982). Model Life Tables for Developing Countries. United Nations Department of International Economic and Social Affairs. Arriaga EE, Johnson PD, Jamison E (1994). Population analysis with microcomputers, volume 1. Bureau of the Census. United Nations (1988). Mortpak The United Nations Software Package for Mortality Measurement. United Nations Department of International Economic and Social Affairs.
# example data from UN 1982 Model Life Tables for Developing Countries. # first Latin American model table for males (p. 34). Mx < c(.23669,.04672,.00982,.00511,.00697,.01036,.01169, .01332,.01528,.01757,.02092,.02517,.03225,.04241,.06056, .08574,.11840,.16226,.23745) ax < c(0.330,1.352,2.500,2.500,2.633,2.586,2.528,2.528, 2.526,2.529,2.531,2.538,2.542,2.543,2.520,2.461,2.386,2.295,4.211) AgeInt < inferAgeIntAbr(vec = Mx) Age < int2age(AgeInt) nAx1 < lt_a_un(nMx = Mx, Age = Age, AgeInt = AgeInt, a0rule = "cd", Sex = "m", region = "w", mod = FALSE) nAx2 < lt_a_un(nMx = Mx, Age = Age, AgeInt = AgeInt, a0rule = "cd", Sex = "m", region = "w", mod = TRUE) # this is acceptable... round(nAx2,3)  ax # only different in ages 59 and 1014, and last two ages#> [1] 0.000 0.000 0.506 0.082 0.000 0.000 0.000 0.000 0.000 0.000 #> [11] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.012 0.566# ignore open age, which is treated differently N < length(ax) # default unit test... stopifnot(all(round(nAx1[Age<80],3)  ax[Age<80] == 0)) # spot on # another example: nMx < c(0.11621,0.02268,0.00409,0.00212,0.00295, 0.00418,0.00509,0.00609,0.00714,0.00808, 0.00971,0.0125,0.0175,0.02551,0.03809, 0.05595,0.0809,0.15353,0.2557) AgeInt < inferAgeIntAbr(vec = nMx) Age < int2age(AgeInt) nAx1 < lt_a_un(nMx, Age = Age, AgeInt = AgeInt, a0rule = "ak", mod = TRUE, closeout = TRUE) nqx < lt_id_ma_q(nMx = nMx, nax = nAx1, AgeInt = AgeInt, closeout = FALSE) nAx2 < lt_a_un(nqx = nqx, Age = Age, AgeInt = AgeInt, a0rule = "ak", mod= TRUE, closeout = TRUE) stopifnot(all(abs(nAx1[Age<75]  nAx2[Age<75]) < 1e7))