When deciding which comorbidity mapping to use in research, it might be useful to compare mapping schemes. For instance, it would be useful to know which comorbidities a pair of mapping schemes share, and which comorbidities only exist in only one mapping scheme. For comorbidites that exist in both mapping schemes, how many ICD codes assigned to those comorbidities overlap? In other words, how similar are the mapping schemes structurally?
To answer these questions, we can use the function
diff_comorbid in the "ICD" package. This function takes in two mapping schemes and outputs a comorbidity-by-comorbidity comparison of the two assignments. The function identifies comorbidities that are shared by both mapping schemes. It then takes each shared comorbidity and returns a list of codes that both mapping schemes assign to that comorbidity. The function returns a list of character lists, and condenses it into a summary of comparisons.
The following example demonstrates the comparison of two different mapping schemes. Say we were interested in comparing the mapping schemes of Elixhauser (1998) and Agency for Healthcare Research and Quality (AHRQ) in classifying ICD-9 codes. We can first use basic set operations to compare the comorbidity names.
Elix_comor <- names(icd9_map_ahrq) AHRQ_comor <- names(icd9_map_elix)
These comorbidities are shared:
These comorbidities are in AHRQ but not in the Elixhauser sets:
Finally, these comorbidities are in Elixhauser but not in the AHRQ sets:
We see that the comorbidity names are almost exactly the same except for Arrhythmia, which exists in the AHRQ mapping but not the Elixhauser mapping.
Now we run the function
diff_comorbid and input the ICD-9 mappings from Elixhauser and AHRQ that are included in the package. The
all_names option can be used if one wants to compare only a selection of comorbidities, in which case one can give a list of comorbidity names. By default, the function will compare all comorbidites in both mapping schemes. Similarly,
y_names can be used to specify the comorbidities to compare in the first and second mapping schemes, respectively. Setting the option
TRUE tells the function to print out the comparison summary, and setting the option
TRUE tells the function to attempt to combine many low-level ICD codes to form just their parent codes for the output, which can be much more concise.
comp <- diff_comorbid(icd9_map_ahrq, icd9_map_elix, show = TRUE, explain = TRUE)
The comparison summary provides the size of the asymmetric difference between mapping schemes for each shared comorbidity, along with a list of a few code descriptions in that difference. This summary doesn't provide a very detailed look at the similarities between comorbidity mappings. We can get a more detailed look at a particular comorbidity by specifying it.
In this example we look at the shared comorbidity Congestive Heart Failure (CHF). Note the list first gives us all the ICD codes that exist in both comorbidity mappings. Then it gives a list called
only.x, followed by a list called
y refer to the first and second mappings given to the function call. In this case,
x refers to the AHRQ ICD-9 mapping, and
y refers to the Elixhauser original 1998 ICD-9 mapping. So
only.x lists all the ICD codes in the AHRQ comorbidity but not the Elixhauser comorbidity. Conversely,
only.y lists all the ICD codes in the Elixhauser comorbidity but not in the AHRQ comorbidity, which in this case is none.
We can see from this comparison that the two mapping schemes are quite similar for this comorbidity. Most of the ICD codes exist in both mappings, and only a handful of mappings exist in the AHRQ mapping but not in the Elixhauser mapping. This makes sense since AHRQ was designed to update the original Elixhauser 1998 comorbidities, and has expanded the comorbidities in annual updates. This means any analysis of CHF that uses either Elixhauser or AHRQ should produce comparable results, since the comorbidity mappings are not wildly different.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.