Comorbidity scores

Alessandro Gasparini

2018-03-07

comorbidity is an R package for computing comorbidity scores based on ICD codes data. As of version 0.1.0, comorbidity can calculate the Charlson comorbidity score and the Elixhauser comorbidity score, using either the ICD-9 or ICD-10 coding system. Details on each score supported by this package are presented in this vignette, along with examples on how to compute the different scores with this software.

Charlson comorbidity score

The Charlson comorbidity index was first developed by Charlson et al. in 1987 to predict one-year mortality for patients who may have a range of comorbid conditions. Each condition is assigned a score depending on the risk of dying associated with each one, and consequently scores are summed to provide a total score to predict mortality.

The Charlson comorbidity index includes the following comorbid conditions: acute myocardial infarction, congestive heart failure, peripheral vascular disease, cerebrovascular disease, dementia, chronic obstructive pulmonary disease [COPD], rheumatoid disease, peptic ulcer disease, mild and moderate/severe liver disease, diabetes mellitus with and without complications, hemiplegia/paraplegia, renal disease, cancer (any malignancy) and metastatic solid tumour, AIDS/HIV.

Many variations of the Charlson comorbidity index have been presented, as outlined by Sharabiani et al. in their systematic review. comorbidity computes the Quan et al. version of the Charlson score for both ICD-9-CM and ICD-10 coding systems, as outlined in their paper from 2005; in the next subsections, we present the different ICD codes utilised by comorbidity. Categorisation of scores and weighted scores is based on work by Menendez et al.

ICD-9-CM codes

The ICD-9-CM codes used by comorbidity to compute the Charlson comorbidity index are:

ICD-10 codes

The ICD-10 codes used by comorbidity to compute the Charlson comorbidity index are:

Weights

Each condition from the Charlson score is assigned a score when computing the weighted Charlson index, irrespectively of the coding system utilised. In particular, diabetes with complications, hemiplegia/paraplegia, renal disease, and malignancies are assigned a score of 2; moderate/severe liver disease is assigned a score of 3; metastatic solid tumour and AIDS/HIV are assigned a score of 6; the remaining comorbidities are assigned a score of 1. comorbidity allows the option of applying a hierarchy of comorbidities should a more severe version be present: by choosing to do so (and that is the default behaviour of comorbidity) a type of comorbidity is never computed more than once for a given patient.

Elixhauser comorbidity score

The Elixhauser comorbidity index, analogously as the Charlson comorbidity index, is a method for measuring patient comorbidity based on ICD-9-CM and ICD-10 diagnosis codes found in administrative data developed by Elixhauser et al. in 1998. Over time, there have been changes to the Index based on different research. For instance:

comorbidity is using the coding definition of Quan et al. (2005) for both ICD-9-CM and ICD-10 coding systems. The weighting is based on work by Moore et al. (2016); however, as the AHRQ Elixhauser comorbidity score only includes 29 comorbidites and not 31 (as in the Quan et al. version), we included weights from van Walraven et al. for the missing comorbidities. The actual codes and weights utilised by comorbidity are introduced in the next subsections. Finally, the categorisation of scores and weighted scores is based on work by Menendez et al.

ICD-9-CM codes

The ICD-9-CM codes used by comorbidity to compute the Elixhauser comorbidity index are:

ICD-10 codes

The ICD-10 codes used by comorbidity to compute the Elixhauser comorbidity index are:

Weights

The weights for the Elixhauser comorbidity index are based on work by Moore et al. (2016): congestive heart failure (9), valvular disease (0), pulmonary circulation disorders (6), peripheral vascular disorders (3), hypertension (-1), paralysis (5), neurodegenerative disorders (5), chronic pulmonary disease (3), uncomplicated diabetes (0), complicated diabetes (-3), hypothyroidism (0), renal failure (6), liver disease (4), peptic ulcer disease with no bleeding (0), AIDS/HIV (0), lymphoma (6), metastatic cancer (14), solid tumour without metastasis (7), rheumatoid arthritis or collagen vascular diseases (0), coagulopathy (11), obesity (-5), weight loss (9), fluid and electrolyte disorders (11), blood loss anemia (-3), deficiency anemia (-2), alcohol abuse (-1), drug abuse (-7), psychosis (-5), depression (-5). The AHRQ version of the Elixhauser index does not include cardiac arrhythmias as a comorbidity; therefore, we utilised the weight from the paper by van Walraven et al. (5) for that specific domain.

Examples

The first step consists in loading the comorbidity package:

library(comorbidity)

We can utilise the built-in sample_diag() function to simulate ICD diagnostic codes. Both ICD-9 and ICD-10 codes are supported:

data9 <- data.frame(
  id = sample(1:10, size = 250, replace = TRUE),
  code = sample_diag(n = 250, version = "ICD9_2015"),
  stringsAsFactors = FALSE
)
data9 <- data9[order(data9$id), ]
data10 <- data.frame(
  id = sample(1:10, size = 250, replace = TRUE),
  code = sample_diag(n = 250, version = "ICD10_2011"),
  stringsAsFactors = FALSE
)
data10 <- data10[order(data10$id), ]

Then, we can go ahead and compute various comorbidity scores and indeces supported by comorbidity. The Charlson score based on ICD-9-CM data is computed as:

charlson9 <- comorbidity(x = data9, id = "id", code = "code", score = "charlson_icd9")
str(charlson9)
#> 'data.frame':    10 obs. of  22 variables:
#>  $ id      : int  1 2 3 4 5 6 7 8 9 10
#>  $ ami     : int  0 0 0 0 0 0 0 0 0 0
#>  $ chf     : int  0 0 0 0 0 0 0 0 0 0
#>  $ pvd     : int  0 0 0 0 0 0 0 0 0 1
#>  $ cevd    : int  0 0 0 0 0 1 0 0 0 0
#>  $ dementia: int  0 0 0 0 0 0 0 0 0 0
#>  $ copd    : int  0 0 0 0 0 0 0 0 0 0
#>  $ rheumd  : int  0 0 0 0 0 0 0 0 0 0
#>  $ pud     : int  0 0 0 0 0 0 0 0 0 0
#>  $ mld     : int  0 0 1 0 0 0 0 0 0 0
#>  $ diab    : int  0 0 0 0 0 0 0 0 0 0
#>  $ diabwc  : int  0 0 0 0 0 0 0 0 0 0
#>  $ hp      : int  1 0 0 0 0 0 0 0 0 0
#>  $ rend    : int  0 0 0 0 0 0 0 0 0 0
#>  $ canc    : int  0 0 1 0 1 1 1 1 1 1
#>  $ msld    : int  0 0 0 0 0 0 0 0 0 0
#>  $ metacanc: int  0 0 0 0 0 0 0 0 0 0
#>  $ aids    : int  0 0 0 0 0 0 0 0 0 0
#>  $ score   : num  1 0 2 0 1 2 1 1 1 2
#>  $ index   : Factor w/ 4 levels "0","1-2","3-4",..: 2 1 2 1 2 2 2 2 2 2
#>  $ wscore  : num  2 0 3 0 2 3 2 2 2 3
#>  $ windex  : Factor w/ 4 levels "0","1-2","3-4",..: 2 1 3 1 2 3 2 2 2 3
#>  - attr(*, "variable.labels")= chr  "ID" "Myocardial infarction" "Congestive heart failure" "Peripheral vascular disease" ...

The Charlson score based on ICD-10 data:

charlson10 <- comorbidity(x = data10, id = "id", code = "code", score = "charlson_icd10")
str(charlson10)
#> 'data.frame':    10 obs. of  22 variables:
#>  $ id      : int  1 2 3 4 5 6 7 8 9 10
#>  $ ami     : int  0 0 0 0 0 0 0 0 0 0
#>  $ chf     : int  0 0 0 0 0 0 0 0 0 0
#>  $ pvd     : int  0 0 0 0 0 0 0 0 0 0
#>  $ cevd    : int  0 0 0 1 0 0 0 0 0 1
#>  $ dementia: int  0 0 0 0 0 0 0 0 0 0
#>  $ copd    : int  0 0 0 0 1 1 0 0 1 0
#>  $ rheumd  : int  0 0 0 0 1 0 0 1 0 0
#>  $ pud     : int  0 0 0 0 0 0 0 0 0 0
#>  $ mld     : int  1 0 0 0 0 0 0 0 0 0
#>  $ diab    : int  0 0 0 0 0 0 0 0 0 0
#>  $ diabwc  : int  0 0 0 0 0 0 0 0 0 0
#>  $ hp      : int  0 0 0 0 0 0 0 0 0 0
#>  $ rend    : int  0 0 0 0 0 0 0 0 0 0
#>  $ canc    : int  0 1 1 1 1 1 0 0 0 1
#>  $ msld    : int  0 0 0 0 0 0 0 0 0 0
#>  $ metacanc: int  0 0 0 0 0 0 0 0 0 0
#>  $ aids    : int  0 0 0 0 0 0 0 0 0 0
#>  $ score   : num  1 1 1 2 3 2 0 1 1 2
#>  $ index   : Factor w/ 4 levels "0","1-2","3-4",..: 2 2 2 2 3 2 1 2 2 2
#>  $ wscore  : num  1 2 2 3 4 3 0 1 1 3
#>  $ windex  : Factor w/ 4 levels "0","1-2","3-4",..: 2 2 2 3 3 3 1 2 2 3
#>  - attr(*, "variable.labels")= chr  "ID" "Myocardial infarction" "Congestive heart failure" "Peripheral vascular disease" ...

The Elixhauser score based on ICD-9-CM data:

elixhauser9 <- comorbidity(x = data9, id = "id", code = "code", score = "elixhauser_icd9")
str(elixhauser9)
#> 'data.frame':    10 obs. of  36 variables:
#>  $ id      : int  1 2 3 4 5 6 7 8 9 10
#>  $ chf     : int  0 0 0 0 0 0 0 0 0 0
#>  $ carit   : int  0 0 0 0 0 1 0 0 0 0
#>  $ valv    : int  0 0 0 0 0 0 0 0 0 0
#>  $ pcd     : int  0 0 0 0 0 0 0 0 0 0
#>  $ pvd     : int  0 0 0 0 0 0 0 0 0 1
#>  $ hypunc  : int  0 0 0 0 0 0 0 0 0 0
#>  $ hypc    : int  0 0 1 0 0 0 0 0 0 0
#>  $ para    : int  1 0 0 0 0 0 0 0 0 0
#>  $ ond     : int  1 0 0 0 0 0 0 0 0 0
#>  $ cpd     : int  0 0 0 0 0 0 0 0 0 0
#>  $ diabunc : int  0 0 0 0 0 0 0 0 0 0
#>  $ diabc   : int  0 0 0 0 0 0 0 0 0 0
#>  $ hypothy : int  0 0 0 0 0 0 0 0 0 0
#>  $ rf      : int  0 0 0 0 0 0 0 0 0 0
#>  $ ld      : int  0 0 1 0 0 0 0 0 0 0
#>  $ pud     : int  0 0 0 0 0 0 0 0 0 0
#>  $ aids    : int  0 0 0 0 0 0 0 0 0 0
#>  $ lymph   : int  0 0 1 0 0 1 1 1 1 0
#>  $ metacanc: int  0 0 0 0 0 0 0 0 0 0
#>  $ solidtum: int  0 0 0 0 1 1 0 0 1 1
#>  $ rheumd  : int  0 0 1 0 0 1 0 0 0 0
#>  $ coag    : int  0 0 0 1 0 0 0 0 0 0
#>  $ obes    : int  0 0 1 0 0 0 0 0 0 0
#>  $ wloss   : int  0 0 0 0 0 0 0 0 0 0
#>  $ fed     : int  0 0 0 0 0 0 0 0 0 0
#>  $ blane   : int  0 0 0 0 0 0 0 0 0 0
#>  $ dane    : int  0 0 0 0 0 0 0 0 0 0
#>  $ alcohol : int  0 0 0 0 0 0 0 0 0 0
#>  $ drug    : int  0 0 0 0 1 0 0 0 0 1
#>  $ psycho  : int  0 0 0 0 1 0 0 0 0 0
#>  $ depre   : int  0 0 0 0 0 0 0 1 0 0
#>  $ score   : num  2 0 5 1 3 4 1 2 2 3
#>  $ index   : Factor w/ 4 levels "<0","0","1-4",..: 3 2 4 3 3 3 3 3 3 3
#>  $ wscore  : num  10 0 4 11 -5 18 6 1 13 3
#>  $ windex  : Factor w/ 4 levels "<0","0","1-4",..: 4 2 3 4 1 4 4 3 4 3
#>  - attr(*, "variable.labels")= chr  "ID" "Congestive heart failure" "Cardiac arrhythmias" "Valvular disease" ...

Finally, the Elixhauser score based on ICD-10 data:

elixhauser10 <- comorbidity(x = data10, id = "id", code = "code", score = "elixhauser_icd10")
str(elixhauser10)
#> 'data.frame':    10 obs. of  36 variables:
#>  $ id      : int  1 2 3 4 5 6 7 8 9 10
#>  $ chf     : int  0 0 0 0 0 0 0 0 0 0
#>  $ carit   : int  0 0 0 0 0 0 0 0 0 0
#>  $ valv    : int  0 0 0 0 0 0 0 0 0 1
#>  $ pcd     : int  0 0 0 0 0 0 0 0 0 0
#>  $ pvd     : int  0 0 0 0 0 0 0 0 0 0
#>  $ hypunc  : int  0 0 0 0 0 0 0 0 0 0
#>  $ hypc    : int  0 0 0 0 0 0 0 0 0 0
#>  $ para    : int  0 0 0 0 0 0 0 0 0 0
#>  $ ond     : int  1 0 0 0 0 0 0 0 1 0
#>  $ cpd     : int  0 0 0 0 1 1 0 0 1 0
#>  $ diabunc : int  0 0 0 0 0 0 0 0 0 0
#>  $ diabc   : int  0 0 0 0 0 0 0 0 0 0
#>  $ hypothy : int  0 0 0 0 1 0 0 0 0 0
#>  $ rf      : int  0 0 0 0 0 0 0 0 0 0
#>  $ ld      : int  1 0 0 0 0 0 0 0 0 0
#>  $ pud     : int  0 0 0 0 0 0 0 0 0 0
#>  $ aids    : int  0 0 0 0 0 0 0 0 0 0
#>  $ lymph   : int  0 0 0 1 0 0 0 0 0 0
#>  $ metacanc: int  0 0 0 0 0 0 0 0 0 0
#>  $ solidtum: int  0 1 1 1 1 1 0 0 0 1
#>  $ rheumd  : int  0 0 0 0 1 0 0 1 0 1
#>  $ coag    : int  0 0 0 0 0 0 0 0 0 0
#>  $ obes    : int  0 0 0 0 0 0 0 0 0 0
#>  $ wloss   : int  0 0 0 0 0 0 0 0 0 0
#>  $ fed     : int  0 0 0 0 0 0 0 0 0 0
#>  $ blane   : int  0 0 0 0 0 0 0 0 0 0
#>  $ dane    : int  0 0 0 0 0 0 0 0 0 0
#>  $ alcohol : int  0 0 0 0 1 0 0 1 0 0
#>  $ drug    : int  0 0 0 0 1 1 0 0 0 0
#>  $ psycho  : int  0 0 0 0 0 0 0 0 0 0
#>  $ depre   : int  0 0 0 0 0 0 0 1 0 0
#>  $ score   : num  2 1 1 2 6 3 0 3 2 3
#>  $ index   : Factor w/ 4 levels "<0","0","1-4",..: 3 3 3 3 4 3 2 3 3 3
#>  $ wscore  : num  9 7 7 13 2 3 0 -6 8 7
#>  $ windex  : Factor w/ 4 levels "<0","0","1-4",..: 4 4 4 4 3 3 2 1 4 4
#>  - attr(*, "variable.labels")= chr  "ID" "Congestive heart failure" "Cardiac arrhythmias" "Valvular disease" ...

References