ineq_quantile: ineq_quantile

View source: R/indices.R

ineq_quantileR Documentation

ineq_quantile

Description

Calculate conditioned quantiles of survivorship from a lifetable, returns full lifetable column.

Usage

ineq_quantile(age, lx, quantile = 0.5)

Arguments

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.

Details

This uses a monotonic spline through the survival curve to approximate continuous survivorship.

See Also

MortalityLaws::MortalityLaw

ungroup::pclm

MortalitySmooth::Mort1Dsmooth

Examples


data(LT)
# The median age at survival
LTmedian <- ineq_quantile(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(age=LT$Age,lx=LT$lx,quantile=0.1) 
# The difference between the bottom 10 and top 10 percent of survival age
ineq_quantile(age=LT$Age,lx=LT$lx,quantile=0.1) -
ineq_quantile(age=LT$Age,lx=LT$lx,quantile=0.9)

alysonvanraalte/LifeIneq documentation built on March 12, 2024, 1:42 p.m.