HMD_old_logquad: HMD pattern for adult ages.

View source: R/log_quad_augm.R

HMD_old_logquadR Documentation

HMD pattern for adult ages.

Description

Adjust rates in oldest ages using HMD pattern, based on log-quad method.

Usage

HMD_old_logquad(
  nMx,
  Age = NULL,
  Sex = "b",
  q0_5 = NULL,
  q15_45 = NULL,
  q60_15 = NULL,
  Age_transition = 80,
  window_transition = 3,
  plot_comparison = FALSE,
  fitted_logquad = NULL,
  ...
)

Arguments

nMx

numeric. Vector of mortality rates in abridged age classes.

Age

integer. Single ages (abridged not allowed).

Sex

character. Either male "m", female "f", or both "b".

q0_5

numeric. Probability of death from born to age 5. By default implicit values in nMx should be entered.

q15_45

numeric. Probability of death from age 15 to age 60. By default implicit values in nMx should be entered.

q60_15

numeric. Probability of death from age 60 to age 75. When external information on those ages level is available, can be included to increase parameter ax from log-quad model in last ages (Li, 2003).

Age_transition

integer. Form which age should transition to HMD pattern starts.

window_transition

integer. Number of ages to the left and to the right of Age_transition to do a log-linear transition in rates.

plot_comparison

Show or not a plot with the result.

fitted_logquad

Optional, defaults to NULL. An object of class wilmoth. If full HMD is not enough, one can fit a Log-Quadratic (https://github.com/mpascariu/MortalityEstimate) model based on any other collection of life tables;

...

Other arguments to be passed on to the lt_single function.

Details

One possible scenario when mortality data on last ages is not reliable, is to use a mortality pattern with some known index in previous ages. This function gives a HMD pattern based on 5q0 and 45q15, using log-quad model. Additionally, a value on mortality between 60 and 75 can be included to make a better adjustment in level.

Value

life table as in lt_single function.

Examples

# Mortality rates from UN Chilean with e0=70. Wat would be the rates based on HMD pattern? 
# In this case making a transition of 10 years at age 80, and returning an OAG=100.
## Not run: 
lt <- DemoToolsData::modelLTx1
lt <- lt[lt$family == "Chilean" & lt$sex == "female" & lt$e0 == 70,]
chilean70_adjHMD <- HMD_old_logquad(nMx = lt$mx1, 
                                         Age = lt$age, 
                                       Sex = "f", 
                                       q0_5 = 1 - lt$lx1[lt$age==5]/lt$lx1[lt$age==0], 
                                       q15_45 = 1 - lt$lx1[lt$age==60]/lt$lx1[lt$age==15],
                                       Age_transition = 80, 
                                       window_transition = 10, 
                                       plot_comparison = TRUE,
                                       OAnew = 100)
# We know (as an example) that q60_15 is .5 higher than  what HMD pattern would be.
chilean70_adjHMD_augm <- HMD_old_logquad(nMx = lt$mx1, 
                                       Age = lt$age, 
                                       Sex = "f", 
                                       q0_5 = 1 - lt$lx1[lt$age==5]/lt$lx1[lt$age==0], 
                                       q15_45 = 1 - lt$lx1[lt$age==60]/lt$lx1[lt$age==15],
                                        q60_15 = (1 - lt$lx1[lt$age==75]/lt$lx1[lt$age==60]) * 1.5, 
                                        Age_transition = 80, window_transition = 10,
                                       OAnew = 100, plot_comparison = TRUE)

## End(Not run)

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