icd9VanWalraven: Calculate van Walraven Elixhauser Score

Description Usage Arguments Methods (by class) Author(s) References Examples

View source: R/score.R

Description

van Walraven Elixhauser score is calculated from the Quan revision of Elixhauser's ICD-9 mapping. This function allows for the hierarchical exlusion of less severe versions of comorbidities when their more severe version is also present via the applyHeirarchy argument. For the Elixhauser comorbidities, this is diabetes v. complex diabetes and solid tumor v. metastatic tumor

Usage

1
2
3
4
5
6
7
8
icd9VanWalraven(x, visitId = NULL, return.df = FALSE,
  stringsAsFactors = getOption("stringsAsFactors"), ...)

## S3 method for class 'data.frame'
icd9VanWalraven(x, visitId = NULL, return.df = FALSE,
  stringsAsFactors = getOption("stringsAsFactors"), ...)

icd9VanWalravenComorbid(x, visitId = NULL, applyHierarchy = FALSE)

Arguments

x

data frame containing a column of visit or patient identifiers, and a column of ICD-9 codes. It may have other columns which will be ignored. By default, the first column is the patient identifier and is not counted. If visitId is not specified, the first column is used.

visitId

The name of the column in the data frame which contains the patient or visit identifier. Typically this is the visit identifier, since patients come leave and enter hospital with different ICD-9 codes. It is a character vector of length one. If left empty, or 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.

return.df

single logical value, if true, a two column data frame will be returned, with the first column named as in input data frame (i.e. visitId), containing all the visits, and the second column containing the Charlson Comorbidity Index.

stringsAsFactors

single logical, passed on when constructing data.frame if 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.

...

further arguments to pass on to icd9ComorbidQuanElix, e.g. icd9Field, applyHeirarchy

applyHierarchy

single logical value, default is FALSE. If TRUE, will drop DM if DMcx is present, etc.

Methods (by class)

Author(s)

wmurphyrd

References

van Walraven C, Austin PC, Jennings A, Quan H, Forster AJ. A Modification to the Elixhauser Comorbidity Measures Into a Point System for Hospital Death Using Administrative Data. Med Care. 2009; 47(6):626-633. http://www.ncbi.nlm.nih.gov/pubmed/19433995

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mydf <- data.frame(visitId = c("a", "b", "c"),
                   icd9 = c("412.93", "441", "044.9"))

print(
  cmb <- icd9ComorbidQuanElix(mydf, isShort = FALSE, applyHierarchy = TRUE, return.df=TRUE)
)
icd9VanWalravenComorbid(cmb)

icd9VanWalraven(mydf)
icd9VanWalraven(mydf, return.df = TRUE)

Example output

The icd9 package is now deprecated. The new 'icd' package is on CRAN and has ICD-10 support and bug-fixes. All the functions available in 'icd9' have been preserved in 'icd', but a simpler set of function names is also available.

To install it, use:
install.packages("icd")
# or for the development version:
devtools::install_github("jackwasey/icd")

Then:
remove.packages("icd9")

  visitId   CHF Arrhythmia Valvular  PHTN   PVD   HTN Paralysis NeuroOther
1       a FALSE      FALSE    FALSE FALSE FALSE FALSE     FALSE      FALSE
2       b FALSE      FALSE    FALSE FALSE  TRUE FALSE     FALSE      FALSE
3       c FALSE      FALSE    FALSE FALSE FALSE FALSE     FALSE      FALSE
  Pulmonary    DM  DMcx Hypothyroid Renal Liver   PUD   HIV Lymphoma  Mets
1     FALSE FALSE FALSE       FALSE FALSE FALSE FALSE FALSE    FALSE FALSE
2     FALSE FALSE FALSE       FALSE FALSE FALSE FALSE FALSE    FALSE FALSE
3     FALSE FALSE FALSE       FALSE FALSE FALSE FALSE  TRUE    FALSE FALSE
  Tumor Rheumatic Coagulopathy Obesity WeightLoss FluidsLytes BloodLoss Anemia
1 FALSE     FALSE        FALSE   FALSE      FALSE       FALSE     FALSE  FALSE
2 FALSE     FALSE        FALSE   FALSE      FALSE       FALSE     FALSE  FALSE
3 FALSE     FALSE        FALSE   FALSE      FALSE       FALSE     FALSE  FALSE
  Alcohol Drugs Psychoses Depression
1   FALSE FALSE     FALSE      FALSE
2   FALSE FALSE     FALSE      FALSE
3   FALSE FALSE     FALSE      FALSE
a b c 
0 2 0 
a b c 
0 2 0 
  visitId vanWalraven
1       a           0
2       b           2
3       c           0

icd9 documentation built on May 30, 2017, 2:25 a.m.