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.
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 )
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 |
y_names | character vector of the comorbidity names from |
show | single logical value. The default is |
explain | single logical value. The default is |
A list, each item of which is another list containing the intersections and both asymmetric differences.
list
: Show difference between comorbidity maps with
ICD-9 codes
# compare CHF for ICD-10 mappings from Elixhauser and AHRQ diff_comorbid(icd10_map_elix, icd10_map_ahrq, show = FALSE)[["CHF"]]#> $both #> [1] "I110" "I130" "I132" "I501" "I5020" "I5021" "I5022" "I5023" "I5030" #> [10] "I5031" "I5032" "I5033" "I5040" "I5041" "I5042" "I5043" "I509" #> #> $only.x #> [1] "I099" "I255" "I420" "I425" "I426" "I427" "I428" "I429" #> [9] "I43" "I50" "I502" "I503" "I504" "I508" "I5081" "I50810" #> [17] "I50811" "I50812" "I50813" "I50814" "I5082" "I5083" "I5084" "I5089" #> [25] "P290" #> #> $only.y #> [1] "I0981" #>if (FALSE) { # 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) }