View source: R/log_quad_augm.R
HMD_old_logquad | R Documentation |
Adjust rates in oldest ages using HMD pattern, based on log-quad method.
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,
...
)
nMx |
numeric. Vector of mortality rates in abridged age classes. |
Age |
integer. Single ages (abridged not allowed). |
Sex |
character. Either male |
q0_5 |
numeric. Probability of death from born to age 5. By default implicit values in |
q15_45 |
numeric. Probability of death from age 15 to age 60. By default implicit values in |
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 |
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 |
plot_comparison |
Show or not a plot with the result. |
fitted_logquad |
Optional, defaults to |
... |
Other arguments to be passed on to the |
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.
life table as in lt_single
function.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.