ineq_quantile_lower | R Documentation |
Calculate quantiles of survivorship from a lifetable. Not vectorized: this function just calculates for the lowest age in the lx
vector given.
ineq_quantile_lower(age, lx, quantile = 0.5)
age |
numeric. vector of lower age bounds. |
lx |
numeric. vector of the lifetable survivorship. |
quantile |
numeric. value between zero and one indicating the quantile desired. |
This uses a monotonic spline through the survival curve to approximate continuous survivorship. Quantile-based methods including iqr
and cp
make use of this function internally.
MortalityLaws::MortalityLaw
ungroup::pclm
MortalitySmooth::Mort1Dsmooth
data(LT)
# The median age at survival
LTmedian <- ineq_quantile_lower(age=LT$Age,lx=LT$lx,quantile=0.5)
LTmedian
# The age reached by 90% of the life table cohort (i.e. the top 10%)
ineq_quantile_lower(age=LT$Age,lx=LT$lx,quantile=0.1)
# The difference between the bottom 10 and top 10 percent of survival age
ineq_quantile_lower(age=LT$Age,lx=LT$lx,quantile=0.1) -
ineq_quantile_lower(age=LT$Age,lx=LT$lx,quantile=0.9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.