lt_id_morq_a_greville | R Documentation |
The UN a(x) formula uses Coale-Demeny for ages 0, and 1-4, values of 2.5 for ages 5-9 and 10-14, and the Greville formula thereafter. In the original sources these are referred to as separation factors.
lt_id_morq_a_greville(
nMx,
nqx,
lx,
Age,
AgeInt = age2int(Age, OAvalue = 5),
a0rule = "ak",
IMR = NA,
Sex = "m",
region = "w",
mod = TRUE,
SRB = 1.05,
closeout = 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. |
Age |
integer. Vector of lower bounds of abridged age groups. |
AgeInt |
integer. Vector of age group intervals. |
a0rule |
character. Either |
IMR |
numeric. Optional. q0, the death probability in first year of life, in case available separately. |
Sex |
character. |
region |
character. |
mod |
logical. Whether or not to use Gerland's modification for ages 5-14. Default |
SRB |
numeric. The sex ratio at birth (boys/girls), default 1.05. |
closeout |
logical. Whether or not to estimate open age a(x) via extrapolation. Default |
extrapLaw |
character. The following options are available:
|
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
|
a(x)
for age 0 and age group 1-4 are based on Coale-Demeny q0-based lookup tables. An approximation to get from M(0) to q0 for the sake of generating a(0) and 4a1 is used. The final a(x) value is closed out using the lt_a_closeout()
method (reciprocal and Mortpak methods are deprecated). Age groups must be standard abridged. No check on age groups is done.
There are different vectors one can specify for this method: ultimately it's either nMx
or nqx
, and the nax
, but nax
results should be reasonably close. For full convergence implying transitivity, instead use lt_a_un()
nax average contribution to exposure of those dying in the interval.
greville1977shortDemoTools \insertRefun1982modelDemoTools \insertRefarriaga1994populationDemoTools \insertRefmortpak1988DemoTools
lt_a_closeout
#Example witn Mexican data from UN
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.08098,
0.15353,0.2557)
nqx <- c(0.10793,0.08554,0.02025,0.01053,0.01463,0.02071,0.02515,0.02999,
0.03507, 0.03958,0.04742,0.0606,0.08381,0.11992,0.17391,0.2454,0.33672,
0.54723,NA)
lx <- c(100000,89207,81577,79924,79083,77925,76312,74393,72162,69631,66875,
63704,59843,54828,48253,39861,30079,19951,9033)
Age <- c(0,1,seq(5,85,by = 5))
AgeInt <- age2int(Age, OAvalue = 5)
# two quite different results depending whether you start with mx or qx
lt_id_morq_a_greville(nMx = nMx,
Age = Age,
AgeInt = AgeInt,
Sex = 'f',
region = 'w')
lt_id_morq_a_greville(nqx = nqx,
Age = Age,
AgeInt = AgeInt,
Sex = 'f',
region = 'w')
# same, qx comes from lx (Except OAG, because qx closed above w NA)
lt_id_morq_a_greville(lx = lx,
Age = Age,
AgeInt = AgeInt,
Sex = 'f',
region = 'w')
# both qx and lx given, but lx not used for anything = same as qx
lt_id_morq_a_greville(nqx = nqx,
lx = lx,
Age = Age,
AgeInt = AgeInt,
Sex = 'f',
region = 'w')
#'
# nMx taken over lx.
lt_id_morq_a_greville(nMx = nMx,
lx = lx,
Sex = 'f',
Age = Age,
AgeInt = AgeInt,
region = 'w')
# example of transitivity. UN ax method is iterative
# and used greville on the inside
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]) < 1e-7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.