racusum_crit: Alarm thresholds of RA-CUSUM charts

Description Usage Arguments Details Value Author(s) References Examples

Description

Compute alarm threshold of risk-adjusted CUSUM charts.

Usage

1
2
3
4
5
racusum_crit_mc(L0, pmix, RA, RQ, scaling = 600, rounding = "p",
  method = "Toep", jmax = 4, verbose = FALSE)

racusum_crit_sim(L0, pmix, RA = 2, RQ = 1, yemp = FALSE, m = 10000,
  nc = 1, hmax = 30, jmax = 4, verbose = FALSE)

Arguments

L0

Double. Prespecified Average Run Length.

pmix

Numeric Matrix. A three column matrix. First column is the risk score distribution. Second column are the predicted probabilities from the risk model. Third column can be either the predicted probabilities from the risk model or average outcome per risk score, see examples.

RA

Double. Odds ratio of death under the alternative hypotheses. Detecting deterioration in performance with increased mortality risk by doubling the odds Ratio RA = 2. Detecting improvement in performance with decreased mortality risk by halving the odds ratio of death RA = 1/2. Odds ratio of death under the null hypotheses is 1. RQ. Use RQ = 1 to compute the in-control ARL and other values to compute the out-of-control ARL.

RQ

Double. Defines the true performance of a surgeon with the odds ratio ratio of death RQ. Use RQ = 1 to compute the in-control ARL and other values to compute the out-of-control ARL.

scaling

Double. The scaling parameter controls the quality of the approximation, larger values achieve higher accuracy but increase the computation burden (larger transition probability matrix).

rounding

Character. If rounding = "p" a paired rounding implementation of Knoth et al. (2019) is used, if rounding = "s" a simple rounding method of Steiner et al. (2000) is used.

method

Character. If method = "Toep" a combination of Sequential Probability Ratio Test and Toeplitz matrix structure is used to calculate the ARL. "ToepInv" computes the inverted matrix using Toeplitz matrix structure. "BE" solves a linear equation system using the classical approach of Brook and Evans (1972) to calculate the ARL.

jmax

Integer. Number of digits for grid search.

verbose

Logical. If FALSE a quiet calculation of h is done. If TRUE verbose output of the search procedure is included.

yemp

Logical. If TRUE, use emirical outcome values, else use model.

m

Integer. Number of simulation runs.

nc

Integer. Number of cores used for parallel processing. Value is passed to parSapply.

hmax

Integer. Maximum value of h for the grid search.

Details

Determines the control limit for given in-control ARL ("L0") using racusum_arl_mc by applying a grid search.

Determines the control limit ("h") for given in-control ARL ("L0") applying a grid search using racusum_arl_sim and parSapply.

Value

Returns a single value which is the control limit h for a given In-control ARL.

Author(s)

Philipp Wittenberg

References

Knoth S, Wittenberg P and Gan FF (2019). Risk-adjusted CUSUM charts under model error. Statistics in Medicine, 38(12), pp. 2206–2218.

Wittenberg P, Gan FF, Knoth S (2018). A simple signaling rule for variable life-adjusted display derived from an equivalent risk-adjusted CUSUM chart. Statistics in Medicine, 37(16), pp 2455–2473.

Steiner SH, Cook RJ, Farewell VT and Treasure T (2000). Monitoring surgical performance using risk-adjusted cumulative sum charts. Biostatistics, 1(4), pp. 441–452.

Brook D and Evans DA (1972) An approach to the probability distribution of CUSUM run length. Biometrika, 59(3), pp. 539–549

Webster RA and Pettitt AN (2007) Stability of approximations of average run length of risk-adjusted CUSUM schemes using the Markov approach: comparing two methods of calculating transition probabilities. Communications in Statistics - Simulation and Computation 36(3), pp. 471–482

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
26
27
28
29
30
31
32
33
34
35
36
37
38
## Not run: 
library(vlad)
library(dplyr)
data("cardiacsurgery", package = "spcadjust")

## Markov Chain
## preprocess data to 30 day mortality and subset phase I (In-control) of surgeons 2
S2I <- cardiacsurgery %>% rename(s = Parsonnet) %>%
  mutate(y = ifelse(status == 1 & time <= 30, 1, 0),
         phase = factor(ifelse(date < 2*365, "I", "II"))) %>%
  filter(phase == "I", surgeon == 2) %>% select(s, y)

## estimate risk model, get relative frequences and probabilities
mod1 <- glm(y ~ s, data = S2I, family = "binomial")
fi  <- as.numeric(table(S2I$s) / length(S2I$s))
usi <- sort(unique(S2I$s))
pi1 <- predict(mod1, newdata = data.frame(s = usi), type = "response")

## set up patient mix
pmix  <- data.frame(fi, pi1, pi1)

## control limit for detecting deterioration RA = 2:
racusum_crit_mc(pmix = pmix, L0 = 740, RA = 2, RQ = 1)
## control limit for detecting improvement RA = 1/2:
racusum_crit_mc(pmix = pmix, L0 = 740, RA = 0.5, RQ = 1)

## Monte Carlo simulation
SALL <- cardiacsurgery %>% rename(s = Parsonnet) %>%
  mutate(y = ifelse(status == 1 & time <= 30, 1, 0),
         phase = factor(ifelse(date < 2*365, "I", "II")))
SI <- subset(SALL, phase == "I")
y <- subset(SALL, select = y)
GLM <- glm(y ~ s, data = SI, family = "binomial")
pi1 <- predict(GLM, type = "response", newdata = data.frame(s = SALL$s))
pmix <- data.frame(y, pi1, pi1)
h <- racusum_crit_sim(pmix = pmix, L0 = 370, RA = 2, nc = 4, verbose = TRUE)

## End(Not run)

vlad documentation built on Feb. 15, 2021, 5:12 p.m.