icd9Charlson(x, visitId = NULL, scoringSystem = c("original", "charlson", "quan"), return.df = FALSE, stringsAsFactors = getOption("stringsAsFactors"), ...)
"icd9Charlson"(x, visitId = NULL, scoringSystem = c("original", "charlson", "quan"), return.df = FALSE, stringsAsFactors = getOption("stringsAsFactors"), ...)
icd9CharlsonComorbid(x, visitId = NULL, applyHierarchy = FALSE, scoringSystem = c("original", "charlson", "quan"))
visitId
is not specified, the first column is used.NULL
, then an
attempt is made to guess which field has the ID for the patient encounter
(not a patient ID, although this can of course be specified directly). The
guesses proceed until a single match is made. Data frames may be wide with
many matching fields, so to avoid false positives, anything but a single
match is rejected. If there are no successful guesses, and visitId
was not specified, then the first column of the data frame is used.original
, charlson
, or quan
.
The first two will give the original Charlson weights for each comorbidity,
whereas quan
uses the updated weights from Quan 2001.visitId
), containing all the visits, and the second column
containing the Charlson Comorbidity Index.return.df
is TRUE
. If the input data frame
x
has a factor for the visitId, this is not changed, but a
non-factor visitId may be converted or not converted according to your
system default or this setting.icd9ComorbidQuanDeyo
, e.g.
icd9Field
data.frame
: Charlson scores from data frame of visits and ICD-9 codes
mydf <- data.frame(visitId = c("a", "b", "c"),
icd9 = c("441", "412.93", "044.9"))
cmb <- icd9ComorbidQuanDeyo(mydf, isShort = FALSE, applyHierarchy = TRUE)
cmb
icd9Charlson(mydf, isShort = FALSE)
icd9Charlson(mydf, isShort = FALSE, return.df = TRUE)
icd9CharlsonComorbid(cmb)
Run the code above in your browser using DataLab