Skip to contents

Build summaries (counts and percentages) for each comorbidity and other summary statistics by method.

Usage

# S3 method for class 'medicalcoder_comorbidities'
summary(object, ...)

Arguments

object

a medicalcoder_comorbidities object generated by calling comorbidities()

...

additional parameters, not currently used

Value

either a list or a data data.frame

Examples

pccc_v3.1_results <-
  comorbidities(data = mdcr,
                icd.codes = "code",
                id.vars = "patid",
                dx.var = "dx",
                method = "pccc_v3.1",
                flag.method = 'current',
                poa = 1)
summary(pccc_v3.1_results)
#>          condition                                   label dxpr_or_tech_count
#> 1  congeni_genetic      Other Congenital or Genetic Defect               3225
#> 2              cvd                          Cardiovascular               5147
#> 3               gi                        Gastrointestinal               5652
#> 4      hemato_immu              Hematologic or Immunologic               2832
#> 5       malignancy                              Malignancy               3784
#> 6        metabolic                               Metabolic               3407
#> 7             misc Miscellaneous, Not Elsewhere Classified                764
#> 8         neonatal                    Premature & Neonatal               1516
#> 9        neuromusc             Neurologic or Neuromuscular               5828
#> 10           renal                          Renal Urologic               2787
#> 11     respiratory                             Respiratory               3260
#> 12    any_tech_dep               Any Technology Dependence               7012
#> 13  any_transplant                     Any Transplantation               1585
#> 14       cmrb_flag                           Any Condition              20871
#> 15        num_cmrb                         >= 2 conditions              10657
#> 16        num_cmrb                         >= 3 conditions               4582
#> 17        num_cmrb                         >= 4 conditions               1571
#> 18        num_cmrb                         >= 5 conditions                418
#> 19        num_cmrb                         >= 6 conditions                 88
#> 20        num_cmrb                         >= 7 conditions                 13
#> 21        num_cmrb                         >= 8 conditions                  2
#> 22        num_cmrb                         >= 9 conditions                  0
#> 23        num_cmrb                        >= 10 conditions                  0
#> 24        num_cmrb                        >= 11 conditions                  0
#>    dxpr_or_tech_percent dxpr_only_count dxpr_only_percent tech_only_count
#> 1           8.428728242            3225         8.4287282               0
#> 2          13.451988919            4560        11.9178297             283
#> 3          14.771836287            1420         3.7112540            3855
#> 4           7.401599498            2832         7.4015995               0
#> 5           9.889707804            3784         9.8897078               0
#> 6           8.904396006            3356         8.7711045              40
#> 7           1.996759187             121         0.3162407             643
#> 8           3.962155664            1516         3.9621557               0
#> 9          15.231822696            4564        11.9282839             316
#> 10          7.283989337            1876         4.9030370             555
#> 11          8.520202812            1848         4.8298573             755
#> 12         18.326276724              NA                NA              NA
#> 13          4.142491245              NA                NA              NA
#> 14         54.547592912              NA                NA              NA
#> 15         27.852699807              NA                NA              NA
#> 16         11.975328002              NA                NA              NA
#> 17          4.105901417              NA                NA              NA
#> 18          1.092467723              NA                NA              NA
#> 19          0.229993205              NA                NA              NA
#> 20          0.033976269              NA                NA              NA
#> 21          0.005227118              NA                NA              NA
#> 22          0.000000000              NA                NA              NA
#> 23          0.000000000              NA                NA              NA
#> 24          0.000000000              NA                NA              NA
#>    tech_only_percent dxpr_and_tech_count dxpr_and_tech_percent
#> 1          0.0000000                   0            0.00000000
#> 2          0.7396372                 304            0.79452198
#> 3         10.0752705                 377            0.98531180
#> 4          0.0000000                   0            0.00000000
#> 5          0.0000000                   0            0.00000000
#> 6          0.1045424                  11            0.02874915
#> 7          1.6805185                   0            0.00000000
#> 8          0.0000000                   0            0.00000000
#> 9          0.8258847                 948            2.47765407
#> 10         1.4505253                 356            0.93042706
#> 11         1.9732372                 657            1.71710836
#> 12                NA                  NA                    NA
#> 13                NA                  NA                    NA
#> 14                NA                  NA                    NA
#> 15                NA                  NA                    NA
#> 16                NA                  NA                    NA
#> 17                NA                  NA                    NA
#> 18                NA                  NA                    NA
#> 19                NA                  NA                    NA
#> 20                NA                  NA                    NA
#> 21                NA                  NA                    NA
#> 22                NA                  NA                    NA
#> 23                NA                  NA                    NA
#> 24                NA                  NA                    NA

charlson_results <-
  comorbidities(data = mdcr,
                icd.codes = "code",
                id.vars = "patid",
                dx.var = "dx",
                method = "charlson_quan2011",
                flag.method = 'current',
                poa = 1)
#> Warning: Assuming all codes provided are secondary diagnostic codes.  Define `primarydx.var` or `primarydx` if this assumption is incorrect.
summary(charlson_results)
#> $conditions
#>                     condition_description condition count      percent
#> 1                                AIDS/HIV   aidshiv     7  0.018294914
#> 2                          Any malignancy       mal  2301  6.013799592
#> 3                 Cerebrovascular disease     cebvd   411  1.074172809
#> 4               Chronic pulmonary disease      copd  3415  8.925304480
#> 5                Congestive heart failure       chf   684  1.787674455
#> 6                                Dementia       dem    13  0.033976269
#> 7     Diabetes with chronic complications       dmc    13  0.033976269
#> 8  Diabetes without chronic complications        dm   441  1.152579583
#> 9                Hemiplegia or paraplegia        hp  1177  3.076159113
#> 10                    Liver disease, mild       mld   593  1.549840573
#> 11      Liver disease, moderate to severe      msld   206  0.538393184
#> 12                 Metastatic solid tumor       mst   453  1.183942293
#> 13                  Myocardial infarction        mi    10  0.026135591
#> 14                   Peptic ulcer disease       pud    45  0.117610162
#> 15            Peripheral vascular disease       pvd   217  0.567142334
#> 16                          Renal disease       rnd   898  2.346976112
#> 17                      Rheumatic disease       rhd   136  0.355444044
#> 18                                   >= 1      <NA>  9841 25.720035544
#> 19                                   >= 2      <NA>  1075  2.809576081
#> 20                                   >= 3      <NA>    94  0.245674560
#> 21                                   >= 4      <NA>     9  0.023522032
#> 22                                   >= 5      <NA>     1  0.002613559
#> 
#> $age_summary
#>   age_score count percent
#> 1      <NA> 38262     100
#> 
#> $index_summary
#>   min q1 median q3 max
#> 1   0  0      0  0  10
#> 

elixhauser_results <-
  comorbidities(data = mdcr,
                icd.codes = "code",
                id.vars = "patid",
                dx.var = "dx",
                method = "elixhauser_ahrq2025",
                primarydx = 1,
                flag.method = 'current',
                poa = 1)
summary(elixhauser_results)
#> $conditions
#>       condition count percent
#> 1          AIDS     0       0
#> 2       ALCOHOL     0       0
#> 3       ANEMDEF     0       0
#> 4    AUTOIMMUNE     0       0
#> 5       BLDLOSS     0       0
#> 6   CANCER_LEUK     0       0
#> 7  CANCER_LYMPH     0       0
#> 8   CANCER_METS     0       0
#> 9  CANCER_NSITU     0       0
#> 10 CANCER_SOLID     0       0
#> 11         CBVD     0       0
#> 12         COAG     0       0
#> 13     DEMENTIA     0       0
#> 14      DEPRESS     0       0
#> 15      DIAB_CX     0       0
#> 16    DIAB_UNCX     0       0
#> 17   DRUG_ABUSE     0       0
#> 18           HF     0       0
#> 19       HTN_CX     0       0
#> 20     HTN_UNCX     0       0
#> 21    LIVER_MLD     0       0
#> 22    LIVER_SEV     0       0
#> 23 LUNG_CHRONIC     0       0
#> 24   NEURO_MOVT     0       0
#> 25    NEURO_OTH     0       0
#> 26   NEURO_SEIZ     0       0
#> 27        OBESE     0       0
#> 28    PARALYSIS     0       0
#> 29     PERIVASC     0       0
#> 30    PSYCHOSES     0       0
#> 31     PULMCIRC     0       0
#> 32   RENLFL_MOD     0       0
#> 33   RENLFL_SEV     0       0
#> 34 THYROID_HYPO     0       0
#> 35  THYROID_OTH     0       0
#> 36 ULCER_PEPTIC     0       0
#> 37        VALVE     0       0
#> 38     WGHTLOSS     0       0
#> 
#> $index_summary
#>         index min q1 median q3 max
#> 1 readmission   0  0      0  0   0
#> 2   mortality   0  0      0  0   0
#>