bootpchsurv: Bootstrap estimator of the adaptive piecewise constant hazard...

Description Usage Arguments Details Value See Also Examples

View source: R/bootpchsurv.R

Description

Given time to event data and a set of cuts return the survival estimator from maximum likelihood estimation in the piecewise constant hazard model

Usage

1
2
3
4
bootpchsurv(time, status, cuts, seqtime = NULL, M = 100,
  verbose = TRUE, tol = 1e-07, itermax = 1e+05,
  pen = exp(seq(log(0.1), log(1000), length = 100)), w = rep(1,
  length(cuts)), a = rep(0, length(cuts) + 1))

Arguments

time

the observed time data.

status

status of the time data. TRUE for true time and FALSE for censored time.

cuts

a sequence of cuts. Default to NULL which corresponds to the exponential model.

seqtime

a time sequence where the survival function is estimated.

M

the number of bootrapped samples.

tol

the tolerance parameter for convergence of the algorithm. Default to 1e-7.

itermax

the maximum number of iterations. If the algorithm has not converged before itermax iterations then the algorithm exits the program. Default to 1e+5.

pen

a sequence of penalty values.

w

the w sequence values for the adaptive ridge algorithm at the initialization step. Default to 1. Should be of the size of the cuts.

a

the log-hazard value at the initialization step. Default to the unpenalized log-hazard estimator.

Details

The bootstrap procedure is performed by sampling on the initial sample. A total of M bootstrap samples are generated. A new estimator is constructed by taking the median of all survival estimate for all bootrapp samples. Confidence intervals are computed using the bootstrap samples.

Value

Result a matrix containing the cumulative hazard estimates for each bootstrap sample
medSurv the median estimator obtained from all bootstrap samples
CIleft the left confidence intervals obtained from the bootstrap samples
CIright the right confidence intervals obtained from the bootstrap samples

See Also

Other pchsurv functions: arpchsurv, mlepchsurv, pchsurv, rsurv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
n=400
cuts=c(20,40,50,70)
alpha=c(0,0.05,0.1,0.2,0.4)/10
time=rsurv(n,cuts,alpha) #generate true data from the pch model
censoring=runif(n,min=70,max=90)
time=pmin(time,censoring) #observed times
delta=time<censoring #gives 62% of observed data on average
Result=bootpchsurv(time,delta,cuts=1:100,M=20)
plot(Result)

#The adaptive ridge estimator
fit=arpchsurv(time,delta,verbose=TRUE,cuts=1:100,CI=TRUE)
fitsurv=pchsurv(time,delta,cuts=fit$final.cuts)
lines(fitsurv,CI=TRUE,col="blue")
seqtime=seq(0,100,by=0.1)
lines(seqtime,exp(-pchcumhaz(seqtime,cuts,alpha)),type="l",col="red") #the true survival function

obouaziz/pchsurv documentation built on Sept. 7, 2020, 11:03 a.m.