Learn R Programming

DTR (version 1.2)

sim.Cox.data: Function to simulate data from sequentially randomized clinical trials (Tang and Wahed 2011)

Description

This function generates a data set from sequentially randomized clinical trials as described in the simulation study of Tang and Wahed (2011). Instead of generating only the data for one of the first-stage assignments (e.g. A1), sim.Cox.data generates 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.

Usage

sim.Cox.data(n, max.c, pi.x, pi.z, lambda, alpha, 
beta1, beta2, beta3, beta4, beta5, gamma)

Arguments

n
total number of subjects participating in the clinical trial
max.c
censoring time C is generated from uniform(0, max.c)
pi.x
the probability of being assigned to A2 at the first stage. The first-stage treatment indicator X is generated from Bernoulli(pi.x). X=0 if assigned to A1 at the first stage, and X=1 if assigned to A2 at the first stage.
pi.z
the probability of being assigned to B2 among responders. The second-stage treatment indicator Z is generated from Bernoulli(pi.z) among responders (R=1). Z=0 if assigned to B1 at the second stage, and Z=1 if assigned to B2 at the second stage. For non-re
lambda
baseline hazard
alpha
a response time TR is drawn from exponential(alpha) with mean equal to 1/alpha
beta1
coefficient for first-stage indicator X
beta2
coefficient for time-varying response indicator R(t)=R*I(TR
beta3
coefficient for the interaction between X and R(t)
beta4
coefficient for the interaction between R(t) and second-stage indicator Z
beta5
coefficient for the three-way interaction among X, R(t), and Z
gamma
coefficient for the covariate V. Covariate V is drawn from normal distribution with mean 1 and standard deviation 0.5

Value

  • The function returns a data set with columns: X, TR, R, Z, U, delta, and V.
  • Xfirst-stage indicator, X=0 if assigned to A1, and X=1 if assigned to A2
  • TRtime to response
  • Rresponse status, R=1 for responders, and R=0 for non-responders
  • Zsecond-stage indicator among responders (R=1), Z=0 if assigned to B1, and Z=1 if assigned to B2
  • Uobserved survival time, U is death time if delta=1, and U is censoring time if delta=0
  • deltacensoring indicator, delta=1 for died, and delta=0 for censored
  • Va continuous covariate following normal distribution with mean 1 and standard deviation 0.5

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

Tang X, Wahed AS: Comparison of treatment regimes with adjustment for auxiliary variables. Journal of Applied Statistics 38(12):2925-2938, 2011

See Also

DTR, DTR.Cox.test

Examples

Run this code
require(DTR)
  
#-------Example function usage-----------
n <- 400
pi.x <- 0.5
pi.z <- 0.5
lambda <- 1/4
alpha <- 1/6
beta1 <- -0.5
beta2 <- -0.8
beta3 <- 0.5
beta4 <- 1
beta5 <- -1
gamma <- -0.5
max.c <- 14

set.seed(123)
fdata <- sim.Cox.data(n,max.c,pi.x,pi.z,lambda,alpha,
beta1,beta2,beta3,beta4,beta5,gamma)

Run the code above in your browser using DataLab