Function for performing life expectancy decomposition for disease groups
decomp_disease(
df,
breakdown,
diseases,
age_col,
group_1,
group_1_m,
group_2,
group_2_m,
nDx
)A data frame with attached life expectancy disease breakdown decomposition values
An outputted life table with relevant columns of interest
Whether disease breakdowns are raw mortality rates or a decimal proportion of total all-cause mortality rate. Accepts either 'proportion' or 'raw'.
Character vector of diseases which are suffixed to group_1 and group_2, and found in both groups. There should be no other characters after these diseases for the function to capture the group-disease combinations.
Column providing ordered age bands with the final age group being an open-ended interval suffxied with '+', e.g. '90+'.. Of factor type.
Unique matching stem prefix in columns for group 1 related disease cause breakdowns
Column name for group 1 all-cause mortality rate between ages x and x + n
Unique matching stem prefix in columns for group 2 related disease cause breakdowns
Column name for group 2 all-cause mortality rate between ages x and x + n
Column name for contribution of all-cause mortality differences in groups 1 and 2 in age groups x to x + n. Computationally the same as the total effect column computed from decomp_LE().