bercusum: Risk-adjusted Bernoulli CUSUM

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

View source: R/bercusum.R

Description

This function can be used to construct a risk-adjusted Bernoulli CUSUM chart on survival data. Specify one of the following combinations for the parameters:

Usage

1
bercusum(data, followup, glmmod, theta, p0, p1, h, stoptime)

Arguments

data

data.frame containing the following named columns:

  • entrytime numeric - time of entry into study,

  • survtime numeric - time from entry until event,

  • censorid integer - (optional) censoring indicator (0 = right censored, 1 = observed),

followup

The followup time for every individual. At what time after entry do we consider the outcome?

glmmod

Generalized linear regression model used for risk-adjustment as produced by the function glm. Standard practice:
glm(as.formula(paste("(survtime <= followup) & (censorid == 1)~" ,paste(covariates, collapse='+'))), data = data).
Alternatively, a list containing:

  • $formula (~ covariates),

  • $coefficients (named vector specifying risk adjustment coefficients for covariates - names must be the same as in $formula and colnames of data).

theta

e^θ is the odds ratio under the alternative hypothesis. Note that:

p1 = (p0 * e^θ)/((1-p0) * (1+p0 e^θ))

p0

The baseline failure probability at entrytime + followup for individuals.

p1

The alternative hypothesis failure probability at entrytime + followup for individuals.

h

(optional) Control limit to be used for the procedure

stoptime

(optional) Time after which the value of the chart should no longer be determined

Details

The Bernoulli CUSUM chart is given by:

S_n = max(0, S_{n-1} + W_n)

with

W_n = X_n ln((p_1 * (1-p_0))/(p_0 * (1-p_1))) + ln((1-p_1)/(1-p_0))

where X_n is the outcome of the n-th (chronological) subject in the data. Instead of displaying patient numbering on the x-axis, the time of outcome is displayed.

Value

An object of class bercusum containing:

There are plot and runlength methods for "bercusum" objects.

Author(s)

Daniel Gomon

See Also

plot.bercusum, runlength.bercusum

Other qcchart: bkcusum(), cgrcusum(), funnelplot()

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))
plot(bercus)

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