Learn R Programming

DTR (version 1.2)

DTR.surv.plot: Survival plot for dynamic treatment regimes (DTRs)

Description

This function plots the survival functions of dynamic treatment regimes (DTRs) from sequentially randomized clinical trials based on the LDT estimator proposed in Lunceford, Davidian and Tsiatis (2002) or the WRSE estimator proposed in Guo and Tsiatis (2005). For simplicity, and to maintain similarity to the most common sequentially randomized clinical trials, a simple two-stage randomization design allowing two treatment options at each stage is implemented in the current version of the function.

Usage

DTR.surv.plot(fdata, method="LDT", L=.Machine$double.xmax, 
confidence.interval=FALSE, xlab="Time", ylab="Survival probability", 
line.color=c("black", "grey40", "grey60", "grey80"), 
legend.position="right")

Arguments

fdata
a data frame (X, TR, R, Z, U, delta) representing the full data from a simple two stage randomization design with therapies A1 and A2 available at the first stage, and B1 and B2 available at the second stage. X: first-stage indicator, X=0 if assigned to
method
the survival estimates to be used for the plot. The survival estimator proposed in Lunceford, Davidian and Tsiatis (2002) is used when method="LDT" (default), and the weighted risk set estimator (WRSE) proposed in Guo and Tsiatis (2005) is used when metho
L
restricted survival time. Default is .Machine$double.xmax, which is the largest double value of R. Set L to a numeric number smaller than the maximum follow-up time if restricted follow-up time up to L is considered. The value of L is only used when metho
confidence.interval
If confidence.interval=FALSE (default), the 95% confidence bands are not plotted. If confidence.interval=TRUE, the 95% confidence bands are plotted as grey shadows.
xlab
label for x axis. Default is "Time".
ylab
label for y axis. Default is "Survival probability".
line.color
colors for the lines. Default are "black", "grey40", "grey60", and "grey80" for A1B1, A1B2, A2B1, and A2B2 respectively.
legend.position
the position of legend: "left", "right" (default), "bottom", "top", or two-element numeric vector (e.g. c(0.6,0.9))

Details

In sequentially randomized designs, there could be more than two therapies available at each stage. For simplicity, and to maintain similarity to the most common sequentially randomized clinical trials, a simple two-stage randomization design allowing two treatment options at each stage is used in the current version of the package. In detail, patients are initially randomized to either A1 or A2 at the first stage. Based on their response status, they are then randomized to either B1 or B2 at the second stage. Therefore, there are a total of four dynamic treatment regimes (DTRs): A1B1, A1B2, A2B1, and A2B2.

References

Lunceford JK, Davidian M, Tsiatis AA: Estimation of survival distributions of treatment policies in two-stage randomization designs in clinical trials. Biometrics 58:48-57, 2002 Guo X, Tsiatis AA: A weighted risk set estimator for survival distributions in two-stage randomization designs with censored survival data. Int. J. Biostatistics 1:1-15, 2005

See Also

DTR, sim.LDT.data, LDT.estimator, sim.WRSE.data, WRSE.estimator

Examples

Run this code
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