tmpm {tmpm} | R Documentation |
Trauma Mortality Prediction Model
Description
An R port for the tmpm trauma mortality prediction model using the ICD-9, ICD-10,
or AIS lexicon in long or wide format. Based upon the tmpm
package
created by Alan Cook, MD for STATA
Usage
tmpm(Pdat,ILex = 1,ICs = marcTable,Long = FALSE)
Arguments
Pdat |
An |
ILex |
An |
ICs |
An |
Long |
A |
Value
The tmpm algorithm will return a data.frame
that contains the
original dataset in wide format with an added last column containing
the calcualted probability of death for each patient.
Note
Uses the Trauma Mortality prediction model created by Turner Osler, MD, MSc and Laurent Glance, MD.
Based upon the tmpm package written in STATA by Alan Cook, MD
Author(s)
Cody Moore
Alan Cook, MD
References
Glance, LG, Osler, TM, Mukamel, DB, et al. TMPM-ICD9 A Trauma Mortality Prediction Model Based on ICD-9-CM Codes. Ann Surg 2009; 249:1032-1039.
Osler, T, Glance, L, Buzas, JS, et al. A Trauma Mortality Prediction Model Based on the Anatomic Injury Scale. Ann surg 2008; 247:1041-1048.
Examples
## To evaluate ICD-9 patient data in wide format
#inc_key dx1 dx2 dx3 dx4
#1 10000007 821.11 822 815.03 823.00
#2 10011410 881.00 891 822.10 813.42
a <- data.frame(matrix(c(10000007,821.11,822,815.03,823,
10011410,881,891,822.1,813.42),nrow = 2,byrow = TRUE))
names(a) <- c("inc_key","dx1","dx2","dx3","dx4")
b <- tmpm(a,9)
## If the dataset is in long format
#inc_key variable value
#1 10000007 dx1 821.11
#2 10011410 dx1 881.00
#3 10000007 dx2 822.00
#4 10011410 dx2 891.00
#5 10000007 dx3 815.03
#6 10011410 dx3 822.10
#7 10000007 dx4 823.00
#8 10011410 dx4 813.42
c <- melt(a,id = "inc_key")
d <- tmpm(c,9,Long = TRUE)