simLDTdata: Function to simulate data from sequentially randomized...

Description Usage Arguments Details Value Note References See Also Examples

Description

This function generates a data set from sequentially randomized clinical trials as described in the simulation study of Lunceford, Davidian and Tsiatis (2002). Because different assignments at the first stage are independent to each other, the function only generates data for one of the assignments at the first stage. For example, if there are two first-stage therapies A1 and A2 available, the function only simulates the data for one of the two arms (e.g. A1).

Usage

1
2
simLDTdata(n, max.c, pi.r, pi.z, lambda, alpha, 
beta1, beta2, L=.Machine$double.xmax)

Arguments

n

number of subjects assigned to A1

max.c

censoring time C is generated from uniform(0, max.c)

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-responders (R=0), Z=0

lambda

for nonresponders (R=0), a survival time T*_lambda is drawn from exponential(lambda) with mean 1/lambda

alpha

for responders, a response time T*_alpha is drawn from exponential(alpha) with mean 1/alpha

beta1

post-response survival time under B1, T*_11 is drawn from exponential(e^beta1)

beta2

post-response survival time under B2, T*_12 is drawn from exponential(e^(beta1+beta2*T*_11))

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.

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.

Value

The function returns a data set with columns: R, Z, U, and delta.

R

response status, R=1 for responders, and R=0 for non-responders

Z

second-stage indicator, Z=0 if assigned to B1, and Z=1 if assigned to B2

U

observed survival time, U is event time if delta=1, and U is censoring time if delta=0

delta

censoring indicator, delta=1 for event, and delta=0 for censored

Note

Set a seed right before simLDTdata will help reproduce the same data.

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

See Also

LDTestimate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 
#-------Example function usage-----------
n <- 100
L <- 1.5
max.c <- 2.5
pi.r <- 0.5
pi.z <- 0.5
lambda <- 1.33
alpha <- 6.67
beta1 <- 0.29
beta2 <- -0.67

# Generate data from SRD
set.seed(123)
data.A1 <- simLDTdata(n,max.c,pi.r,pi.z,
lambda,alpha,beta1,beta2,L)
data.A2 <- simLDTdata(n,max.c,pi.r,pi.z,
lambda,alpha,beta1,beta2,L)
LDTdata <- cbind(X=c(rep(0,n), rep(1,n)), 
rbind(data.A1, data.A2)) # X=0 for A1; X=1 for A2

DTR documentation built on May 2, 2019, 3:26 p.m.