runlength: Determine run length of a CUSUM chart

Description Usage Arguments Value Methods (by class) Author(s) See Also Examples

View source: R/runlength.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

Author(s)

Daniel Gomon

See Also

Other utils: calc_risk(), exp_hazards, gen_arriv_times(), gen_surv_times()

Other utils: calc_risk(), exp_hazards, gen_arriv_times(), gen_surv_times()

Other utils: calc_risk(), exp_hazards, gen_arriv_times(), gen_surv_times()

Examples

1
2
3
4
5
6
7
8
varsanalysis <- c("age", "sex", "BMI")
exprfitber <- as.formula(paste("(entrytime <= 365) & (censorid == 1)~",
                               paste(varsanalysis, collapse='+')))
surgerydat$instance <- surgerydat$Hosp_num
glmmodber <- glm(exprfitber, data = surgerydat, family = binomial(link = "logit"))
bercus <- bercusum(data = subset(surgerydat, Hosp_num == 14), glmmod = glmmodber,
                   followup = 100, theta = log(2))
runlength(bercus, h = 2)

cgrcusum documentation built on Nov. 22, 2021, 9:09 a.m.