This function can be used to calculate the run length of a 'cgrcusum', 'bkcusum' or 'bercusum' chart when using control limit h
runlength(chart, h)## S3 method for class 'cgrcusum'runlength(chart, h,...)## S3 method for class 'bkcusum'runlength(chart, h,...)## S3 method for class 'bercusum'runlength(chart, h,...)
Arguments
chart: A cgrcusum, bkcusum or bercusum chart.
h: Control limit h to be used when determining the run length
...: Other parameters
Returns
The run length of the chart with the given control limit.
Methods (by class)
runlength(cgrcusum): determines runlength of cgrcusum object
runlength(bkcusum): determines runlength of bkcusum object
runlength(bercusum): determines runlength of bercusum object
Examples
exprfitber <- as.formula("(survtime <= 100) & (censorid == 1) ~ age + sex + BMI")glmmodber <- glm(exprfitber, data = surgerydat, family = binomial(link ="logit"))bercus <- bernoulli_cusum(data = subset(surgerydat, unit ==14), glmmod = glmmodber, followup =100, theta = log(2))#Determine the run length of the above Bernoulli CUSUM when using a control limit#of h = 1.runlength(bercus, h =1)