powered by
This function maps a matrix of ICD9 codes to AHRQ comorbidity measures.
cmbd(icd, drg = NULL, needClean = TRUE, needPrep = TRUE)
a character matrix of icd9 codes, with rows representing patients.
a numeric vector of drg codes, with length the same as nrow(icd).
nrow(icd)
logical, TRUE means cleaning is needed (string trimming, zero supplementation)
logical, TRUE means preparation is needed (convert char to numeric)
a matrix with the same number of rows as the input and with the comorbidity measures in columns
Elixhauser et. al. (1998)
# NOT RUN { data(dxDat) drg <- dxDat$drg icd <- dxDat[, -1L] output <- cmbd(icd, drg=drg) # }
Run the code above in your browser using DataLab