Learn R Programming

decompositionLE (version 1.0.0)

decomp_disease: Title decomp_disease

Description

Function for performing life expectancy decomposition for disease groups

Usage

decomp_disease(
  df,
  breakdown,
  diseases,
  age_col,
  group_1,
  group_1_m,
  group_2,
  group_2_m,
  nDx
)

Value

A data frame with attached life expectancy disease breakdown decomposition values

Arguments

df

An outputted life table with relevant columns of interest

breakdown

Whether disease breakdowns are raw mortality rates or a decimal proportion of total all-cause mortality rate. Accepts either 'proportion' or 'raw'.

diseases

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.

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.

group_1

Unique matching stem prefix in columns for group 1 related disease cause breakdowns

group_1_m

Column name for group 1 all-cause mortality rate between ages x and x + n

group_2

Unique matching stem prefix in columns for group 2 related disease cause breakdowns

group_2_m

Column name for group 2 all-cause mortality rate between ages x and x + n

nDx

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