Description Usage Arguments Details Value Author(s) References Examples
Compute alarm threshold of risk-adjusted CUSUM charts.
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)
|
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 |
RQ |
Double. Defines the true performance of a surgeon with the odds ratio ratio of death
|
scaling |
Double. The |
rounding |
Character. If |
method |
Character. If |
jmax |
Integer. Number of digits for grid search. |
verbose |
Logical. If |
yemp |
Logical. If |
m |
Integer. Number of simulation runs. |
nc |
Integer. Number of cores used for parallel processing. Value is passed to
|
hmax |
Integer. Maximum value of |
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
.
Returns a single value which is the control limit h
for a given In-control ARL.
Philipp Wittenberg
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.