cpsurv {CPsurv}  R Documentation 
Change point estimation for survival data based on exact binomial test.
cpsurv(time, event, cpmax, intwd, cpmin = 0, censoring = c("random",
"type1", "no"), censpoint = NULL, biascorrect = FALSE,
parametric = FALSE, B.correct = 49, opt.start = c(0.1, 50),
boot.ci = FALSE, B = 999, conf.level = 0.95, norm.riskset = TRUE,
seed = NULL, parallel = TRUE, cores = 4L)
time 
Numeric vector with survival times. 
event 
Numeric vector indicating censoring status; 0 = alive (censored), 1 = dead (uncensored). If missing, all observations are assumed to be uncensored. 
cpmax 
Upper bound for estimated change point. Time period is split into intervals up to this point. Has to be an integer value. 
intwd 
Width of intervals into which the time period is split; default
is 
cpmin 
Lower bound for estimated change point; default is

censoring 
Type of rightcensoring for simulated data on which the bootstrap bias correction is based. Possible types are "random" for random censoring (default), "type1" for Type I censoring or "no" for data without censored observations. Because simulated data should be similar to given data, the censoring type is adapted from vector 'events' if given and argument 'censoring' is ignored than. 
censpoint 
Point of Type I censoring; if missing, minimum time after which all events are equal to 0 is used. Censpoint is only needed for bootstrap bias correction. 
biascorrect 
Logical; if 
parametric 
Indicator for parametric biascorrection (see Details for more information). 
B.correct 
Number of bootstrap samples for biascorrection; defaults to 49. 
opt.start 
Numeric vector of length two; initial values for the Weibull parameters (shape and scale parameters) to be optimized if parametric bootstrap bias correction is used. 
boot.ci 
Indicator if confidence intervals (and thereby standard deviation) should be calculated by bootstrap sampling. Please note the extended runtime (see details for examples). 
B 
Number of bootstrap samples for confidence intervals; defaults to 999. 
conf.level 
Confidence level for bootstrap confidence intervals. 
norm.riskset 
Logical; if 
seed 
Seed for random number generator (optional). 
parallel 
Indicator if bootstrapsampling is executed parallelized (based on package 'parallel'); operating system is identified automatically. 
cores 
Number of CPUcores that are used for parallelization; maximum possible value is the detected number of logical CPU cores. 
Change point is a point in time, from which on the hazard rate is
supposed to be constant. For its estimation the timeline up to cpmax
is split into equidistant intervals of width intwd
and exact
binomial tests are executed for each interval. The change point is
estimated by fitting a regression model on the resulting pvalues. See
Brazzale et al (2017) for details.
For bootstrap bias
correction the change point is estimated for a given number
(B.correct
) of bootstrap samples whereupon the bias is built by
subtracting their median from primary estimation. Depending on argument
parametric
the data for bootstrapping are simulated either
parametric (Weibull distributed with estimated shape and scale parameters)
or nonparametric (based on KaplanMeier estimation).
cp  estimated change point 
p.values  pvalues resulting from exact binomial test 
pv.mean  mean of pvalues for intervals above the estimated change point 
lower.lim  lower interval limits 
upper.lim  upper interval limits 
cp.bc  bias corrected change point 
ml.shape  ML estimator of shape parameter for Weibull distribution 
ml.scale  ML estimator of scale parameter for Weibull distribution 
cp.boot  estimated change points for bootstrap samples 
sd  standard deviation estimated by bootstrap sampling 
ci.normal  confidence interval with normal approximation 
ci.percent  bootstrap percentile interval 
conf.level  the conf.level argument passed to
cpsurv 
B  the B argument passed to
cpsurv 
time  the time argument passed to
cpsurv 
event  the event argument passed to
cpsurv 
cpmax  the cpmax argument passed to
cpsurv 
intwd  the intwd argument passed to
cpsurv 
call  matched call 
Stefanie Krügel stefanie.kruegel@gmail.com
Brazzale, A. R. and Küchenhoff, H. and Krügel, S. and Hartl, W. (2017) Nonparametric change point estimation for survival distributions with a partially constant hazard rate.
data(survdata)
# estimate change point for survdata (random censored)
cp < cpsurv(survdata$time, survdata$event, cpmax = 360, intwd = 20)
summary(cp)
## Not run:
# estimation with parametric bootstrap bias correction
cp_param < cpsurv(survdata$time, survdata$event, cpmax = 360, intwd = 20,
biascorrect = TRUE, parametric = TRUE)
summary(cp_param)
# with bootstrap confidence intervals and parametric bootstrap bias
cp_ci < cpsurv(survdata$time, survdata$event, cpmax = 360, intwd = 20,
biascorrect = TRUE, parametric = FALSE, boot.ci = TRUE, cores = 4, seed = 36020)
# runtime: approx. 180 min (with Intel(R) Core(TM) i7 CPU 950 @ 3.07GHz, 4 logical CPUs used)
## End(Not run)