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)

  • runlength(cgrcusum): determines runlength of cgrcusum object

  • runlength(bkcusum): determines runlength of bkcusum object

  • runlength(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, 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)

success documentation built on June 22, 2024, 10:19 a.m.