| reclass {ems} | R Documentation |
Comparisson of the Standardized Resource Use (SRU)
Description
Compares ICU's (intensive care units) SRU with diferent severity classes or compares ICU's SRU at two diferents times. This comparison checks if the ICUs remains in the same quadrant after a time period, and highlights their rank changes over time.
plot.reclass Plots a SMR vs. SRU scatter plot with the ICUs which had their quadrant/rank classification changed.
print.reclass Prints a table with information about which ICUs changed from a classification to another.
Usage
reclass(
x,
y,
same = TRUE,
plot = FALSE,
digits = 2,
compare = c("SRU", "SMR", "BOTH"),
decreasing = FALSE,
complete.rank = TRUE
)
## S3 method for class 'reclass'
print(x, ...)
## S3 method for class 'reclass'
plot(
x,
...,
xlim_x = range(x$smr_x),
ylim_x = range(x$sru_x),
xlim_y = range(x$smr_y),
ylim_y = range(x$sru_y),
xlab = "SMR",
ylab = "SRU",
points.arg_x = list(pch = 21, col = "white", bg = "yellow", cex = 2),
points.arg_y = list(pch = 21, col = "white", bg = "yellow", cex = 2),
med.arg_x = list(col = "dodgerblue4", lwd = 2, lty = 1),
med.arg_y = list(col = "dodgerblue4", lwd = 2, lty = 1),
tert.arg_x = list(col = "darkorange2", lty = 2, lwd = 1),
tert.arg_y = list(col = "darkorange2", lty = 2, lwd = 1),
text.arg_x = list(labels = seq(1, nrow(x$tab)), cex = 0.6),
text.arg_y = list(labels = seq(1, nrow(x$tab)), cex = 0.6),
worse.arg_x = list(x = x$worse_x, pch = 21, col = "white", bg = "tomato", cex = 2),
worse.arg_y = list(x = x$worse_y, pch = 21, col = "white", bg = "tomato", cex = 2),
better.arg_x = list(x = x$better_x, pch = 21, col = "white", bg = "mediumseagreen",
cex = 2),
better.arg_y = list(x = x$better_y, pch = 21, col = "white", bg = "mediumseagreen",
cex = 2),
auto.legend = TRUE,
leg.arg = list(x = "topleft", bty = "n", xpd = NA, inset = c(-1.8, -0.2), ncol = 1,
horiz = F, pch = 19, cex = 0.8, pt.cex = 1.5),
main.arg_x = list(main = "1st Stage"),
main.arg_y = list(main = "2nd Stage")
)
Arguments
x, y |
Objects of class 'SRU'. x is the SRU analsys from the 1st period (e.g. first trimester) and y from the 2nd period (e.g. second trimester). For |
same |
Logical; If |
plot |
Logical. If |
digits |
Integer indicating the number of decimal places to be used in the output. |
compare |
The way one prefers to benchmark the ICUs: by "SRU" (default), "SMR" or "BOTH". If "BOTH", the ICUs will be ranked by their SRU. |
decreasing |
Logical. Should the sort order of ICU's rank be increasing or decreasing? |
complete.rank |
Logical. If |
... |
Arguments to be passed to methods (see |
xlim_x, ylim_x |
Limits for x and y axis for 1st stage plot for |
xlim_y, ylim_y |
Limits for x and y axis for 2nd stage plot for |
xlab, ylab |
Labels of x and y axis for |
points.arg_x, points.arg_y |
List of arguments passed to |
med.arg_x, med.arg_y |
List of arguments passed to |
tert.arg_x, tert.arg_y |
List of arguments passed to |
text.arg_x, text.arg_y |
List of arguments passed to |
worse.arg_x, worse.arg_y |
List of arguments passed to |
better.arg_x, better.arg_y |
List of arguments passed to |
auto.legend |
Logical. If |
leg.arg |
List of arguments passed to |
main.arg_x, main.arg_y |
List of arguments passed to |
Value
reclass retunrs a data.frame with the following columns:
-
UnitNames of the ICU. AdmissionNumber of admissions in each ICU.-
FromICU's initial efficiency quadrant. -
ToICU's final efficiency quadrant. -
SRU.1stICU's initial SRU estimate. -
SRU.2ndICU's final SRU estimate. -
SMR.1stICU's initial SMR estimate. -
SMR.2ndICU's final SMR estimate. -
Rank1ICU's initial SRU (or SMR) rank. -
Rank2ICU's final SRU (or SMR) rank.
plot.reclass returns a scatter plot with grpahical comparison of the two periods/stages with their respective medians and tertiles.
Author(s)
Lunna Borges and Pedro Brasil
See Also
Examples
data(icu)
# A little editing
icu$Saps3DeathProbabilityStandardEquation <- icu$Saps3DeathProbabilityStandardEquation / 100
icu <- icu[-which(icu$los < 0 ),]
# Subseting the data for the 1st quarter
x <- droplevels(icu[which(format(as.Date(icu$UnitAdmissionDate),"%m") %in% c("01","02","03")),])
# Subseting the data for the 2nd quarter
y <- droplevels(icu[which(format(as.Date(icu$UnitAdmissionDate),"%m") %in% c("04","05","06")),])
# Running the SRU analysis for both quarters
FirstQ <- SRU(prob = x$Saps3DeathProbabilityStandardEquation, death = x$UnitDischargeName,
unit = x$Unit, los = x$los, score = x$Saps3Points, originals = TRUE, type = 1, plot = FALSE)
FirstQ
SecondQ <- SRU(prob = y$Saps3DeathProbabilityStandardEquation, death = y$UnitDischargeName,
unit = y$Unit, los = y$los, score = y$Saps3Points, originals = TRUE, type = 1, plot = FALSE)
SecondQ
z <- reclass(x = FirstQ, y = SecondQ, same = TRUE)
z
plot(z)
rm(icu, x, y, FirstQ, SecondQ, z)