eocusum_crit_sim: Compute alarm threshold of EO-CUSUM control charts using...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/eocusum_sim.R

Description

Compute alarm threshold of EO-CUSUM control charts using simulation.

Usage

1
2
eocusum_crit_sim(L0, pmix, k, RQ = 1, side = "low", yemp = FALSE,
  m = 10000, nc = 1, hmax = 30, jmax = 4, verbose = FALSE)

Arguments

L0

Double. Prespecified in-control Average Run Length.

pmix

Data Frame. A three column data frame. First column is the operation outcome. 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.

k

Double. Reference value of the CUSUM control chart. Either 0 or a positive value. Can be determined with function optimal_k.

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.

side

Character. Default is "low" to calculate ARL for the upper arm of the V-mask. If side = "up", calculate the lower arm of the V-mask.

yemp

Logical. If TRUE use observed outcome value, if FALSE use estimated binary logistc regression 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.

jmax

Integer. Number of digits for grid search.

verbose

Logical. If TRUE verbose output is included, if FALSE a quiet calculation of h is done.

Details

Determines the control limit ("h") for given in-control ARL ("L0") applying a grid search using eocusum_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

Barnard GA (1959). Control charts and stochastic processes. J R Stat Soc Series B Stat Methodol, 21(2), pp. 239–271.

Kemp KW (1961). The Average Run Length of the Cumulative Sum Chart when a V-mask is used. J R Stat Soc Series B Stat Methodol, 23(1),pp. 149–153.

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.

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
## Not run: 
library(vlad)
library(dplyr)
data("cardiacsurgery", package = "spcadjust")

## preprocess data to 30 day mortality
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)

## (Deterioration)
kopt <- optimal_k(pmix = pmix, RA = 2)
h <- eocusum_crit_sim(L0=370, pmix=pmix, k=kopt, side = "low", verbose=TRUE, nc=4)

## parameters to set up a tabular CUSUM or V-Mask (upper arm)
d <- h/kopt
theta <- atan(kopt)*180/pi
cbind(kopt, h, theta, d)

## (Improvement)
kopt <- optimal_k(pmix = pmix, RA = 1/2)
h <- eocusum_crit_sim(L0=370, pmix=pmix, k=kopt, side = "up", verbose=TRUE, nc=4)

## parameters to set up a tabular CUSUM or V-Mask (lower arm)
d <- h/kopt
theta <- atan(kopt)*180/pi
cbind(kopt, h, theta, d)

## End(Not run)

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