cusum: Creats a cusum chart and cusum log-likelihood chart

Description Usage Arguments Value Author(s) References See Also Examples

Description

Implementation of an unadjusted cusum chart and cusum log-likelihood chart as described in Rogers et al. (2004)

Usage

1
2
  cusum(failure_indicator, p0, p1, alpha = 0.01,
    beta = 0.01, by = NULL, loglike_chart = FALSE)

Arguments

failure_indicator

a numeric indicator variable consiting of only c(0,1), where 0 is no failure and 1 is failure for each procedure

p0

a constant representing the fixed acceptable event rate when the process is in control

p1

a constant representing the fixed unacceptable event rate we want to detect

alpha

Type I error (the probability of concluding that the failure rate has increased, when in fact it has not)

beta

Type II error (the probability of concluding that the failure rate has not increased, when in fact it has)

by

a factor vector consisting of the stratification variable.

loglike_chart

a flag controling which kind of chart will be shown

Value

an object of the class ggplot

Author(s)

Alexander Meyer

References

Rogers, C. A., Reeves, B. C., Caputo, M., Ganesh, J. S., Bonser, R. S., & Angelini, G. D. (2004). Control chart methods for monitoring cardiac surgical performance and their interpretation Chris. The Journal of Thoracic and Cardiovascular Surgery, 128(6), 811–819. doi:10.1016/j.jtcvs.2004.03.011

See Also

Other cusum: cusum.obs_minus_exp, cusum.sprt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(16)
df = data.frame(
 is_failure = c(rbinom(50,1,0.10),rbinom(50,1,0.08),rbinom(50,1,0.05),
                 rbinom(50,1,0.10),rbinom(50,1,0.13),rbinom(50,1,0.14),
                 rbinom(50,1,0.14),rbinom(50,1,0.09),rbinom(50,1,0.25)
 ),
 p0 = c(rnorm(50, 0.10, 0.03),rnorm(50, 0.10, 0.03),rnorm(50, 0.10, 0.03),
         rnorm(50, 0.10, 0.03),rnorm(50, 0.10, 0.03),rnorm(50, 0.10, 0.03),
         rnorm(50, 0.10, 0.03),rnorm(50, 0.15, 0.03),rnorm(50, 0.20, 0.03)
 ),
 by=rep(factor(c("Surgeon A", "Surgeon B", "Surgeon C")), times=c(150,150,150))
)
cusum_plot = cusum(df$is_failure, .10, .20, alpha=0.01,beta=0.01, loglike_chart=TRUE, by=df$by)
print(cusum_plot)
cusum_plot = cusum(df$is_failure, .10, .20, alpha=0.01,beta=0.01, loglike_chart=FALSE, by=df$by)
print(cusum_plot)

meyera/rcusum documentation built on May 22, 2019, 7:54 p.m.