Learn R Programming

decompositionLE (version 1.0.0)

decomp_age: Title decomp_age

Description

Function for performing life expectancy decomposition for age bands

Usage

decomp_age(df, method = "arriaga3", age_col, e1, e2, l1, l2, append = TRUE)

Value

A data frame with attached life expectancy age breakdown decomposition values

Arguments

df

An outputted life table with columns for age bands, number of persons alive at each age band and expectation of life at each age band

method

Methods to use for life expectancy decomposition. Defaults to 'arriaga3'. Current methods available are: 'arriaga3', 'chandrasekaran1', 'chandrasekaran2'.

age_col

Column providing ordered age bands with the final age group being an open-ended interval suffxied with '+', e.g. '90+'.. Of factor type.

e1

Column name for expectation of life at age group x, in the 1st group of comparison.

e2

Column name for expectation of life at age group x, in the 2nd group of comparison.

l1

Column name for the proportion of persons alive at age group x, in the 1st group of comparison.

l2

Column name for the proportion of persons alive at age group x, in the 2nd group of comparison.

append

Whether to append the decomposition columns to the original data frame. Default to TRUE.