cgrcusum: Continuous time Generalized Rapid response CUSUM (CGR-CUSUM)

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

View source: R/cgrcusum.R

Description

This function performs the CGR-CUSUM procedure described in ARTICLE UNDER REVIEW FOR PUBLICATION. For detection purposes, it is sufficient to only determine the value of the chart at the times of failure. This can be achieved by leaving ctimes empty.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cgrcusum(
  data,
  coxphmod,
  cbaseh,
  ctimes,
  h,
  stoptime,
  C,
  pb = FALSE,
  cmethod = "memory2"
)

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

and optionally additional covariates used for risk-adjustment.

coxphmod

(optional) a cox proportional hazards regression model as produced by the function coxph(). Standard practice:
coxph(Surv(survtime, censorid) ~ covariates, data = data).
Alternatively, a list with:

  • $formula (~ covariates)

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

cbaseh

a function which returns the non risk-adjusted cumulative baseline hazard H_0(t). If cbaseh is missing but coxphmod has been specified as a survival object, this baseline hazard rate will be determined using the provided coxphmod.

ctimes

(optional) vector of construction times at which the value of the chart should be determined. When not specified, the chart is constructed at all failure times.

h

(optional) value of the control limit. The chart will only be constructed until the value of the control limit has been reached or surpassed.

stoptime

(optional) time after which the value of the chart should no longer be determined. Default = max(failure time). Useful when ctimes has not been specified.

C

(optional) a numeric value indicating how long after entering the study patients should no longer influence the value of the chart. This is equivalent to right-censoring every observation at time entrytime + C.

pb

(optional) boolean indicating whether a progress bar should be shown. Default = FALSE

cmethod

One of the following:

  • "memory2" (default) Matrix formulation of the problem (faster for high volume/long time construction - less RAM than "memory")

  • "CPU" Calculates the value of the CGR-CUSUM for every time point from scratch. Recommended for small data volume (lower initialization time).

  • "memory" (outdated) Matrix formulation of the problem (faster for high volume/long time construction - may require much RAM)

Details

The CGR-CUSUM can be used to test for a change of unknown positive fixed size θ in the subject-specific hazard rate from h_i(t) to h_i(t) exp(θ) starting from some unknown patient ν. The starting time of the first patient which had an increase in failure rate as well as the estimated increase in the hazard rate are also given in the output. The CGR-CUSUM is determined as:

max{1<=ν<=n} (θ_{>=ν}(t)N_{>=ν}(t)) - (exp(θ_{>=ν}(t))-1) Λ_{>=ν}(t))

with

N_{>=ν}(t) = ∑_{i>=ν} N_i(t)

with N_i(t) the counting process for the failure at time t of subject i and

Λ_{>=ν}(t) = ∑_{i>=ν}Λ_i(t)

the with Λ_i(t) the cumulative intensity of subject i at time t.

Value

An object of class "cgrcusum" containing:

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

Author(s)

Daniel Gomon

See Also

plot.cgrcusum, runlength.cgrcusum

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

Examples

1
2
3
4
5
6
7
8
9
require(survival)
tdat <- subset(surgerydat, Hosp_num == 1)
tcbaseh <- function(t) chaz_exp(t, lambda = 0.01)
varsanalysis <- c("age", "sex", "BMI")
exprfit <- as.formula(paste("Surv(survtime, censorid) ~" ,paste(varsanalysis, collapse='+')))
tcoxmod <- coxph(exprfit, data= surgerydat)
#Alternatively, cbaseh can be left empty when specifying coxphmod through coxph()
cgr <- cgrcusum(data = tdat, coxphmod = tcoxmod, cbaseh = tcbaseh, pb = TRUE)
plot(cgr)

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