generateClinicalTrialData {sp23design} | R Documentation |
A function to generate some clinical trial data according the joint model of response and survival for simulations
Description
The data is generated according to the model specified in the reference below, specifically,
\lambda(t \mid Y,Z)=\lambda_0(t) \exp(\alpha Y + \beta Z + \gamma Y
Z)
Usage
generateClinicalTrialData(nRec, nFUp, pi0, pi1, theta, lambda0, blockSize = 10)
Arguments
nRec |
the number of patients recruited every year. Length(nRec) is the number of years of recruitment |
nFUp |
the number of additional years of followup |
pi0 |
the probability of response under control arm |
pi1 |
the probability of response under treatment arm |
theta |
the three dimensional parameter |
lambda0 |
the baseline hazard rate |
blockSize |
the size of the blocks for randomization of the treatment/control; we use block randomization |
Details
Generates data from an exponentail distribution according to the model and adhering to the recruitment goals for each calendar year
Value
A data frame consisting of the following variables.
entryTime |
entry time of the patient into the trial |
responseIndicator |
an indicator of patient being a responder or not |
treatmentIndicator |
an indicator of patient being in treatment arm or control |
timeToEvent |
the time to event or death in the language of the paper |
Author(s)
Mei-Chiung Shih, Balasubramanian Narasimhan, Pei He
References
Lai, Tze Leung and Lavori, Philip W. and Shih, Mei-Chiung. Sequential Design of Phase II-III Cancer Trials, Statistics in Medicine, Volume 31, issue 18, p.1944-1960, 2012.
Examples
trialParameters <- list(minimumNumberOfEvents = 20,
minimumIncreaseInV = 0.2,
numberRecruitedEachYear = c(80, 120, 160, 160),
followupTime = 3,
adminCensoringTime = 7,
interimLookTime = c(1, 2, 3, 5, 7),
type1ErrorForResponse = 0.05,
type2ErrorForResponse = 0.01,
glrBoundarySidedness = "one", # one sided or two-sided
type1Error = 0.05,
type2Error = 0.10,
epsType1 = 1/3,
epsType2 = 1/3)
trueParameters <- list(p0 = 0.3,
p1 = 0.3,
pdiffHyp=0.3,
theta = list(
alpha = 0,
beta = 0,
gamma = 0),
baselineLambda = 0.35,
etaHyp = 0.25)
rngSeed <- 9872831
d <- generateClinicalTrialData(nRec = trialParameters$numberRecruitedEachYear,
nFUp = trialParameters$followupTime,
pi0 = trueParameters$p0,
pi1 = trueParameters$p1,
theta = trueParameters$theta,
lambda0 = trueParameters$baselineLambda)