ineq_iqr: ineq_iqr

View source: R/indices.R

ineq_iqrR Documentation

ineq_iqr

Description

Calculate the interquartile range survivorship age from a lifetable. Other quantile ranges can also be calculated.

Usage

ineq_iqr(age, lx, upper = 0.75, lower = 0.25)

Arguments

age

numeric. vector of lower age bounds.

lx

numeric. vector of the lifetable survivorship.

upper

numeric. upper survival quantile, default .75

lower

numeric. lower survival quantile, defauly .25

Details

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).

See Also

MortalityLaws::MortalityLaw

ungroup::pclm

MortalitySmooth::Mort1Dsmooth

Examples


data(LT)
# The iqr range of survival age
iqr <- ineq_iqr(age=LT$Age,lx=LT$lx)
iqr
# age distance between 10th and 90th percentiles
idr <- ineq_iqr(age=LT$Age,lx=LT$lx,upper=.9,lower=.1)
idr

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