ineq_drewnowski | R Documentation |
This index is the simple complement of the gini coefficient, and we include it due to Aburto et al (2022)
ineq_drewnowski(
age,
dx,
ex,
ax,
distribution_type = c("aad", "rl"),
check = TRUE
)
age |
numeric. vector of lower age bounds. |
dx |
numeric. vector of the lifetable death distribution. |
ex |
numeric. vector of remaining life expectancy. |
ax |
numeric. vector of the average time spent in the age interval of those dying within the interval. |
distribution_type |
character. Either |
check |
logical. Shall we perform basic checks on input vectors? Default TRUE |
All input vectors must be the same length. Also, we recommend using input data from a life table by single year of age with a highest age group of at least age 110. If your data have a lower upper age bound, consider extrapolation methods, for instance a parametric Kannisto model (implemented in MortalityLaws::MortalityLaw
). If your data are abridged, consider first smoothing over age, and calculating a life table by single year of age (for instance by smoothing with a pclm model in package ungroup
or with a penalized B-spline approach in package MortalitySmooth
).
The formula for calculating the Gini was taken from the Shkolnikov (2010) spreadsheet, and is a simplification of the formulas described in Shkolnikov (2003) and Hanada (1983). This implementation allows the gini coefficient for both shortfall (remaining life) Shkolnikov (2010) and age-at-death (Permanyer 2019) distributions. This is the inverse of the Drewnowski index.
aburto2022drewnowskiLifeIneq \insertRefhanada1983LifeIneq \insertRefshkolnikov2003LifeIneq \insertRefshkolnikov2010LifeIneq
data(LT)
# A vector containing the conditional age-at-death Drewnowski coefficients
D = ineq_drewnowski(age=LT$Age,dx=LT$dx,ex=LT$ex,ax=LT$ax, distribution_type = "aad")
# A vector containing the conditional remaining life Gini coefficients
Dr = ineq_drewnowski(age=LT$Age,dx=LT$dx,ex=LT$ex,ax=LT$ax, distribution_type = "rl")
# To show how this relates to Gini:
G = ineq_gini(age=LT$Age,dx=LT$dx,ex=LT$ex,ax=LT$ax, distribution_type = "aad")
Gr = ineq_gini(age=LT$Age,dx=LT$dx,ex=LT$ex,ax=LT$ax, distribution_type = "rl")
## Not run:
plot(0:110, Dr, type='l',col="red",ylab="conditional Gini",xlab="Age",ylim=c(0,1))
lines(0:110, D, col = "blue")
lines(0:110, Gr, col = "red", lty=2)
lines(0:110, G, col = "blue", lty=2)
legend("left",col = c("red","blue","red","blue"), lty=c(1,1,2,2),
legend = c("remaining life Drewnowski","age at death Drewnowski",
"remaining life Gini", "age at death Gini"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.