cgrcusum {cgrcusum}  R Documentation 
This function performs the CGRCUSUM 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.
cgrcusum(
data,
coxphmod,
cbaseh,
ctimes,
h,
stoptime,
C,
pb = FALSE,
cmethod = "memory2"
)
data 
and optionally additional covariates used for riskadjustment. 
coxphmod 
(optional) a cox proportional hazards regression model as produced by
the function

cbaseh 
a function which returns the non riskadjusted cumulative
baseline hazard 
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 rightcensoring every observation at time 
pb 
(optional) boolean indicating whether a progress bar should be shown. Default = FALSE 
cmethod 
One of the following:

The CGRCUSUM can be used to test for a change of unknown positive fixed size \theta
in the subjectspecific hazard rate from h_i(t)
to h_i(t) e^\theta
starting from some unknown patient \nu
. 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 CGRCUSUM is determined as:
\max_{1 \leq \nu \leq n} \left( \hat{\theta}_{\geq \nu}(t) N_{\geq \nu}(t)  \left( \exp\left( \hat{\theta}_{\geq \nu}(t) \right)  1 \right) \Lambda_{\geq \nu}(t)\right)
with
N(\geq \nu)(t) = \sum_{i \geq \nu} N_i(t)
with N_i(t)
the counting process for the failure at time t of subject i
and
\Lambda_{\geq \nu}(t) = \sum_{i \geq \nu} \Lambda_i(t)
the
with \Lambda_i(t)
the cumulative intensity of subject i at time t.
An object of class "cgrcusum" containing:
CGR
: a data.frame with named columns:
$time (time of construction),
$value (value of the chart at $time),
$exp_theta_t (value of MLE e^{\theta_t}
),
$S_nu (time from which patients are considered for constructing the chart)
call
: Contains the call
used to obtain output;
stopind
: (only if h specified) Boolean indicating whether the chart was stopped by the provided value of h;
h
: Specified value for the control limit;
There are plot
and
runlength
methods for "cgrcusum" objects.
Daniel Gomon
plot.cgrcusum
, runlength.cgrcusum
Other qcchart:
bercusum()
,
bkcusum()
,
funnelplot()
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)