ineq_cov: ineq_cov

View source: R/indices.R

ineq_covR Documentation

ineq_cov

Description

Calculate a lifetable column for the conditional coefficient of variation in lifetable ages at death

Usage

ineq_cov(age, dx, ex, ax, distribution_type = c("aad", "rl"), check = TRUE)

Arguments

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 "aad" (age at death) or "rl" (remaining life)

check

logical. Shall we perform basic checks on input vectors? Default TRUE

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)
# A vector containing the conditional coefficient of variation in age at death 
CoV = ineq_cov(age=LT$Age,dx=LT$dx,ex=LT$ex,ax=LT$ax)
# The coefficient of variation in age at death from birth
CoV[1]
# The coefficient of variation in age at death conditional upon survival to age 10
CoV[11]

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