reclass: Comparisson of the Standardized Resource Use (SRU)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/reclass.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 print.reclass or plot.reclass, x is an object of class 'reclass'.

same

Logical; If TRUE, compare the same units, with the same severity classes at two consecutive time periods (default). If same = TRUE and the ICUs do not match exactly in 'x' and 'y', there is a warning and non matching units are discarded from the analysis. If FALSE, it compares the same units, with different severity classes within the same period. In this case, if the ICUs do not match exactly in 'x' and'y', the function will return an error.

plot

Logical. If TRUE (default), plots a SMR vs. SRU scatter plot highlighting the ICUs which had their classification changed.

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 TRUE (default), returns all ICUs ranked. If FALSE, returns only ICUs whose efficiency classification ranked changed.

...

Arguments to be passed to methods (see par).

xlim_x, ylim_x

Limits for x and y axis for 1st stage plot for plot.reclass.

xlim_y, ylim_y

Limits for x and y axis for 2nd stage plot for plot.reclass.

xlab, ylab

Labels of x and y axis for plot.reclass.

points.arg_x, points.arg_y

List of arguments passed to points for plotting points correponding to units' SMR and SRU in 1st and 2nd stage plots for plot.reclass.

med.arg_x, med.arg_y

List of arguments passed to abline for plotting lines corresponding to SRU and SMR medians in 1st and 2nd stage plots for plot.reclass.

tert.arg_x, tert.arg_y

List of arguments passed to abline for plotting lines corresponding to SRU and SMR tertiles in 1st and 2nd stage plots for plot.reclass.

text.arg_x, text.arg_y

List of arguments passed to text for plotting units labels in 1st and 2nd stage plots for plot.reclass.

worse.arg_x, worse.arg_y

List of arguments passed to points for plotting points correponding to units which got their rank worse in 1st and 2nd stage plots for plot.reclass.

better.arg_x, better.arg_y

List of arguments passed to points for plotting points correponding to units which got their rank better in 1st and 2nd stage plots for plot.reclass.

auto.legend

Logical. If TRUE, it prints a legend with leg.arg arguments for plot.reclass.

leg.arg

List of arguments passed to legend for plotting legends corresponding to SRU and SMR medians and tertiles in 1st and 2nd stage plots for plot.reclass.

main.arg_x, main.arg_y

List of arguments passed to plot for the titles for the 1st and 2nd stage plots for plot.reclass.

Value

reclass retunrs a data.frame with the following columns:

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

SRU, SMR, funnel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)

ems documentation built on Dec. 11, 2021, 9:15 a.m.

Related to reclass in ems...