Learn R Programming

icd (version 3.3)

diff_comorbid: show the difference between two comorbidity mappings

Description

Compares two comorbidity to ICD code mappings. The results are returned invisibly as a list. Only those comorbidities with (case sensitive) overlapping names are compared.

Usage

diff_comorbid(x, y, all_names = NULL, x_names = NULL, y_names = NULL,
  show = TRUE, explain = TRUE)

# S3 method for list diff_comorbid(x, y, all_names = NULL, x_names = NULL, y_names = NULL, show = TRUE, explain = TRUE)

icd_diff_comorbid.list(...)

icd_diff_comorbid(...)

Arguments

x

list of character vectors

y

list of character vectors

all_names

character vector of the comorbidity names

x_names

character vector of the comorbidity names from x to compare

y_names

character vector of the comorbidity names from y to compare

show

single logical value. The default is TRUE which causes a report to be printed.

explain

single logical value. The default is TRUE which means the differing codes are attempted to be reduced to their parent codes, in order to give a more succinct summary.

...

arguments passed on to other functions

Value

A list, each item of which is another list containing the intersections and both asymmetric differences.

Methods (by class)

  • list: Show difference between comorbidity maps with ICD-9 codes

Deprecated function names

Future versions of icd will drop the icd_ prefix. For example, charlson should be used in favor of icd_charlson. To distinguish icd function calls, consider using the prefix icd:: instead, e.g., icd::charlson. Functions which specifically operate on either ICD-9 or ICD-10 codes or their sub-types will retain the prefix. E.g. icd9_comorbid_ahrq. icd specific classes also retain the prefix, e.g., icd_wide_data.

Examples

Run this code
# NOT RUN {
# compare CHF for ICD-10 mappings from Elixhauser and AHRQ
diff_comorbid(icd10_map_elix, icd10_map_ahrq, show = FALSE)[["CHF"]]
# }
# NOT RUN {
# default is to show the results in a human readable manner:
diff_result <- diff_comorbid(icd9_map_elix, icd9_map_ahrq)[["CHF"]]
# show differences for
# give full report on all comorbidities for these mappings
diff_result <- diff_comorbid(icd9_map_elix, icd9_map_ahrq, show = FALSE)

# the following outputs a summary to the console:
diff_comorbid(icd9_map_elix, icd9_map_ahrq)
# }

Run the code above in your browser using DataLab