simLRdata: 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 Kidwell and Wahed (2013).

Usage

1
2
3
simLRdata(n,max.c,pi.x,pi.r,pi.z,
mean.NR.1,mean.NR.2,mean.R.1,mean.R.2,
mean.RE.11,mean.RE.12,mean.RE.21,mean.RE.22)

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.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

mean.NR.1

for patients who are assigned to A1 (X=0) and do not respond (R=0), a survival time T.NR.1 is drawn from exponential(1/mean.NR.1) with mean equal to mean.NR.1

mean.NR.2

for patients who are assigned to A2 (X=1) and do not respond (R=0), a survival time T.NR.2 is drawn from exponential(1/mean.NR.2) with mean equal to mean.NR.2

mean.R.1

for patients who are assigned to A1 (X=0) and respond (R=1), time to response T.R.1 is drawn from exponential(1/mean.R.1) with mean equal to mean.R.1

mean.R.2

for patients who are assigned to A2 (X=1) and respond (R=1), time to response T.R.2 is drawn from exponential(1/mean.R.2) with mean equal to mean.R.2

mean.RE.11

for patients who are assigned to A1 (X=0), respond (R=1), and then assigned to B1 (Z=0), a time from response to event is generated from exponential(1/mean.RE.11) with mean equal to mean.RE.11

mean.RE.12

for patients who are assigned to A1 (X=0), respond (R=1), and then assigned to B2 (Z=1), a time from response to event is generated from exponential(1/mean.RE.12) with mean equal to mean.RE.12

mean.RE.21

for patients who are assigned to A2 (X=1), respond (R=1), and then assigned to B1 (Z=0), a time from response to event is generated from exponential(1/mean.RE.21) with mean equal to mean.RE.21

mean.RE.22

for patients who are assigned to A2 (X=1), respond (R=1), and then assigned to B2 (Z=1), a time from response to event is generated from exponential(1/mean.RE.22) with mean equal to mean.RE.22

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: X, TR, R, Z, U, and delta.

X

first-stage indicator, X=0 if assigned to A1, and X=1 if assigned to A2

TR

time to response for responders (R=1)

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 simLRdata will help reproduce the same data.

References

Kidwell KM, Wahed AS: Weighted log-rank statistic to compare shared-path. adaptive treatment strategies. Biostatistics. 14(2):299-312, 2013

See Also

contrast_logrank

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
max.c <- 12 # 30% censoring
pi.x <- 0.5
pi.r <- 0.6 # 60% response rate
pi.z <- 0.5
mean.NR.1 <- 1
mean.NR.2 <- 1
mean.R.1 <- 1
mean.R.2 <- 1
mean.RE.11 <- 5
mean.RE.12 <- 5
mean.RE.21 <- 5
mean.RE.22 <- 5

set.seed(123)
LRdata <- simLRdata(n,max.c,pi.x,pi.r,
pi.z,mean.NR.1,mean.NR.2,mean.R.1,mean.R.2,
mean.RE.11,mean.RE.12,mean.RE.21,mean.RE.22)

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