eocusum_crit_sim {vlad} | R Documentation |
Compute alarm threshold of EO-CUSUM control charts using simulation.
eocusum_crit_sim(L0, k, df, coeff, m = 100, yemp = TRUE, side = "low", nc = 1, jmax = 4, verbose = FALSE)
L0 |
Double. Prespecified in-control Average Run Length. |
k |
Double. Reference value of the CUSUM control chart. Either |
df |
Data Frame. First column are Parsonnet Score values within a range of |
coeff |
Numeric Vector. Estimated coefficients alpha and beta from the binary logistic regression model. For more information see details. |
m |
Integer. Number of simulation runs. |
yemp |
Logical. If |
side |
Character. Default is |
nc |
Integer. Number of cores. |
jmax |
Integer. Number of digits for grid search. |
verbose |
Logical. If |
The function eocusum_crit_sim
determines the control limit for given in-control
ARL (L0
) by applying a multi-stage search procedure which includes secant rule and the
parallel version of eocusum_arl_sim
using mclapply
.
Returns a single value which is the control limit h
for a given ARL.
Philipp Wittenberg
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.
## Not run: data("cardiacsurgery", package = "spcadjust") library("dplyr") ## 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 coefficients from logit model coeff1 <- coef(glm(y ~ s, data = S2I, family = "binomial")) ## Number of simulation runs m <- 10^3 set.seed(1234) ## Number of cores nc <- parallel::detectCores() ## determine k for detecting deterioration kopt <- optimal_k(QA = 2, df = S2I, coeff = coeff, yemp = FALSE) ## compute threshold for prespecified in-control ARL h <- eocusum_crit_sim(L0 = 370, df = S2I, k = kopt, m = m, coeff = coeff1, side = "low", nc = nc) ## parameters to set up a tabular CUSUM or V-Mask d <- h/kopt theta <- atan(kopt)*180/pi cbind(kopt, h, theta, d) ## End(Not run)