runlength: Determine run length of a CUSUM chart

View source: R/runlength.R

runlengthR Documentation

Determine run length of a CUSUM chart

Description

This function can be used to calculate the run length of a 'cgrcusum', 'bkcusum' or 'bercusum' chart when using control limit h

Usage

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

Value

The run length of the chart with the given control limit.

Methods (by class)

  • cgrcusum: determines runlength of cgrcusum object

  • bkcusum: determines runlength of bkcusum object

  • bercusum: determines runlength of bercusum object

Author(s)

Daniel Gomon

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, hosp_num == 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)

d-gomon/cgrcusum documentation built on May 3, 2022, 9:40 p.m.