require(DTR)
#-------Example function usage-----------
n <- 500
max.c <- 3.5*365
pi.r <- 0.5
pi.z <- 0.5
mean.T0 <- 182.5
mean.TR <- 365
mean.T1 <- 365
mean.T2 <- 547.5
# Generate A1 data from SRD
set.seed(123) # Set a seed to reproduce the same data every time running the following command
data <- sim.WRSE.data(n,max.c,pi.r,pi.z,mean.T0,mean.TR,mean.T1,mean.T2)
# Generate full data from SRD
set.seed(123)
data.A1 <- sim.WRSE.data(n,max.c,pi.r,pi.z,mean.T0,mean.TR,mean.T1,mean.T2)
data.A2 <- sim.WRSE.data(n,max.c,pi.r,pi.z,mean.T0,mean.TR,mean.T1,mean.T2)
fdata <- cbind(X=c(rep(0,n), rep(1,n)), rbind(data.A1, data.A2)) # X=0 for A1; X=1 for A2
# Plot survival function
DTR.surv.plot(fdata, method="LDT", confidence.interval=TRUE)
Run the code above in your browser using DataLab