Learn R Programming

DTR (version 1.7)

simCHRdata: Function to simulate data from sequentially randomized clinical trials (Tang and Wahed 2013 [Epub ahead of print])

Description

This function generates a data set from sequentially randomized clinical trials as described in the simulation study of Tang and Wahed (2013) [Epub ahead of print].

Usage

simCHRdata(n,max.c,pi.x,pi.r,pi.z,gamma10,
gamma11,gamma12,gamma20,gamma21,gamma22,alpha10,
alpha11,alpha12,alpha20,alpha21,alpha22,beta)

Arguments

n
total number of subjects participating in the clinical trial
max.c
censoring time C is generated from uniform(max.c/2, 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.r
the probability of response. Response status R is generated from Bernoulli(pi.r)
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
gamma10
for individuals who are assigned to A1 at first-stage, and do not respond, survival times are drawn from Weibull distribution with parameters alpha10 and gamma10
gamma11
for individuals who are assigned to A1 at first-stage, respond to A1, and are assigned to B1 at second-stage, survival times are drawn from Weibull distribution with parameters alpha11 and gamma11
gamma12
for individuals who are assigned to A1 at first-stage, respond to A1, and are assigned to B2 at second-stage, survival times are drawn from Weibull distribution with parameters alpha12 and gamma12
gamma20
for individuals who are assigned to A2 at first-stage, and do not respond, survival times are drawn from Weibull distribution with parameters alpha20 and gamma20
gamma21
for individuals who are assigned to A2 at first-stage, respond to A2, and are assigned to B1 at second-stage, survival times are drawn from Weibull distribution with parameters alpha21 and gamma21
gamma22
for individuals who are assigned to A2 at first-stage, respond to A2, and are assigned to B2 at second-stage, survival times are drawn from Weibull distribution with parameters alpha22 and gamma22
alpha10
for individuals who are assigned to A1 at first-stage, and do not respond, survival times are drawn from Weibull distribution with parameters alpha10 and gamma10
alpha11
for individuals who are assigned to A1 at first-stage, respond to A1, and are assigned to B1 at second-stage, survival times are drawn from Weibull distribution with parameters alpha11 and gamma11
alpha12
for individuals who are assigned to A1 at first-stage, respond to A1, and are assigned to B2 at second-stage, survival times are drawn from Weibull distribution with parameters alpha12 and gamma12
alpha20
for individuals who are assigned to A2 at first-stage, and do not respond, survival times are drawn from Weibull distribution with parameters alpha20 and gamma20
alpha21
for individuals who are assigned to A2 at first-stage, respond to A2, and are assigned to B1 at second-stage, survival times are drawn from Weibull distribution with parameters alpha21 and gamma21
alpha22
for individuals who are assigned to A2 at first-stage, respond to A2, and are assigned to B2 at second-stage, survival times are drawn from Weibull distribution with parameters alpha22 and gamma22
beta
the coefficient vector for two covariates V1 and V2, for example, beta=c(0.5,0.5). Both covariates V1 and V2 are generated from Bernoulli(0.5)

Value

  • The function returns a data set with columns: X, R, Z, U, delta, V1 and V2.
  • Xfirst-stage indicator, X=0 if assigned to A1, and X=1 if assigned to A2
  • 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 event time if delta=1, and U is censoring time if delta=0
  • deltacensoring indicator, delta=1 for event, and delta=0 for censored
  • V1a binary covariate following Bernoulli(0.5)
  • V2a binary covariate following Bernoulli(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: Cumulative hazard ratio estimation for treatment regimes in sequentially randomized clinical trials. Statistics in Biosciences, 2013 [Epub ahead of print]

See Also

CHRestimate

Examples

Run this code
#-------Example function usage-----------
n <- 200
max.c <- 5
pi.x <- 0.5
pi.r <- 0.6
pi.z <- 0.5
gamma10 <- 1
gamma11 <- 1.5
gamma12 <- 1.2
gamma20 <- 1
gamma21 <- 1.5
gamma22 <- 1.3
alpha10 <- 0.5
alpha11 <- 0.2
alpha12 <- 0.1
alpha20 <- 0.5
alpha21 <- 0.2
alpha22 <- 0.05
beta <- c(0.5, 0.5)

set.seed(123)
CHRdata <- simCHRdata(n,max.c,pi.x,pi.r,
pi.z,gamma10,gamma11,gamma12,gamma20,gamma21,
gamma22,alpha10,alpha11,alpha12,alpha20,alpha21,
alpha22,beta)

Run the code above in your browser using DataLab