Learn R Programming

vlad (version 0.1.0)

eocusum_arl_h_sim: Compute alarm threshold of EO-CUSUM control charts using simulation

Description

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

Usage

eocusum_arl_h_sim(L0, k, df, coeff, m = 100, yemp = TRUE, side = "low",
  nc = 1, verbose = FALSE)

Arguments

L0

double. Prespecified in-control Average Run Length.

k

double. Reference value of the CUSUM control chart.

df

DataFrame. First column are Parsonnet Score values within a range of zero to 100 representing the preoperative patient risk. The second column are binary (0/1) outcome values of each operation.

coeff

NumericVector. Estimated coefficients \(\alpha\) and \(\beta\) from the binary logistic regression model. For more information see details.

m

integer. Number of simulation runs.

yemp

boolean. Use emirical outcome value.

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.

nc

integer. Number of cores.

verbose

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

Value

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

Details

The function eocusum_arl_h_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.

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. doi: 10.2307/2985287.

Examples

Run this code
# NOT RUN {
library("vlad")
library("spcadjust")
set.seed(1234)
data("cardiacsurgery")
df1 <- subset(cardiacsurgery, select=c(Parsonnet, status))
## estimate coefficients from logit model
coeff1 <- round(coef(glm(status~Parsonnet, data=df1, family="binomial")), 3)
## Number of simulation runs
m <- 10^3
## Number of cores
nc <- parallel::detectCores()
## Detect deterioration
QA <- 2
kopt <- optimal_k(QA=QA, parsonnetscores=df1$Parsonnet, coeff=coeff1)
h <- eocusum_arl_h_sim(L0=370, df=df1, k=kopt, m=m, coeff=coeff1, side="low", nc=nc)
## V-Mask parameters
d <- h/kopt
theta <- atan(kopt)*180/pi
cbind(kopt, h, theta, d)
# }

Run the code above in your browser using DataLab