Type: | Package |
Title: | Design and Simulation of Seamless Phase II-III Clinical Trials |
Version: | 0.9-1 |
Date: | 2022-04-18 |
Author: | Balasubramanian Narasimhan [aut, cre], Mei-Chiung Shih [aut], Pei He [aut] |
Maintainer: | Balasubramanian Narasimhan <naras@stat.stanford.edu> |
Description: | Provides methods for generating, exploring and executing seamless Phase II-III designs of Lai, Lavori and Shih using generalized likelihood ratio statistics. Includes pdf and source files that describe the entire R implementation with the relevant mathematical details. |
Depends: | R (≥ 3.0) |
Imports: | mvtnorm, survival |
Suggests: | RUnit |
License: | LGPL-3 |
NeedsCompilation: | no |
Packaged: | 2022-04-19 00:19:50 UTC; naras |
Repository: | CRAN |
Date/Publication: | 2022-04-19 10:00:02 UTC |
sp23design: A package for the design, exploration and execution of seamless Phase II-II clinical trials
Description
This package implements the methodology described in the paper below
Details
Package: | sp23design |
Type: | Package |
Version: | 1.0 |
Date: | 2011-05-05 |
License: | LGPL? |
LazyLoad: | yes |
The most important functions in this package are
generateSP23Design
, exploreSP23Design
,
executeSP23Design
, and analyzeSP23Design
Author(s)
Mei-Chiung Shih, Balasubramanian Narasimhan, Pei He
Maintainer: Balasubramanian Narasimhan <naras@stat.stanford.edu>
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
## Not run:
catn <- function(...) cat(..., "\n")
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
sp23Design <- generateSP23Design(trueParameters, trialParameters)
print(sp23Design)
trialHistory <- exploreSP23Design(sp23Design, numberOfSimulations=25, rngSeed=rngSeed)
result <- analyzeSP23Design(sp23Design, trialHistory)$designSummary
catn("numberOfTimesH0RIsRejectedAtFirstLook", result[["numberOfTimesH0RIsRejectedAtFirstLook"]])
catn("numberOfTimesH0RIsRejected", result[["numberOfTimesH0RIsRejected"]])
catn("numberOfTimesStoppedForFutility", result[["numberOfTimesStoppedForFutility"]])
catn("numberOfTimesH0SIsAccepted", result[["numberOfTimesH0SIsAccepted"]])
catn("numberOfTimesH0SIsRejected", result[["numberOfTimesH0SIsRejected"]])
catn("numberOfTimesFutilityDecidedAtLastLook",result[["numberOfTimesFutilityDecidedAtLastLook"]])
catn("numberOfTimesTrialEndedAtLook", result[["numberOfTimesTrialEndedAtLook"]])
catn("avgExitTime", result[["avgExitTime"]])
## End(Not run)
Analyses the results of running a design. If a trial history, such as
the result of the function executeSP23Design
or a history
of the actual conduct of a single trial is provided, it returns the
analysis results.
Description
Produces analysis results from the run of a single trial or a number of simulations.
Usage
analyzeSP23Design(sp23Design, trialHistory = NULL, data = NULL,
col=c("red", "red", "brown", "brown"), lty=c(1,2,1,2))
Arguments
sp23Design |
The design object typically produced by calling
|
trialHistory |
Typically the result of calling |
data |
This is only used when the argument |
col |
Colors used for the survival plots |
lty |
Line types for the survival plots |
Details
If trialHistory
is a single data frame, the naive response
estimates and a survival plot are produced. Otherwise, the counts of
the number of times the various hypothesis are rejected and other
details are returned.
Value
A list of two items named responseSummary
and designSummary
If trialHistory
is a single data frame, the naive response
estimates are returned in responseSummary
and a survival plot
is produced. Otherwise, the counts of the number of times the various
hypothesis are rejected and other details are returned in
designSummary
.
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
## Not run:
catn <- function(...) cat(..., "\n")
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
sp23Design <- generateSP23Design(trueParameters, trialParameters)
print(sp23Design)
trialHistory <- exploreSP23Design(sp23Design, numberOfSimulations=25, rngSeed=rngSeed)
result <- analyzeSP23Design(sp23Design, trialHistory)$designSummary
catn("numberOfTimesH0RIsRejectedAtFirstLook",result[["numberOfTimesH0RIsRejectedAtFirstLook"]])
catn("numberOfTimesH0RIsRejected", result[["numberOfTimesH0RIsRejected"]])
catn("numberOfTimesStoppedForFutility", result[["numberOfTimesStoppedForFutility"]])
catn("numberOfTimesH0SIsAccepted", result[["numberOfTimesH0SIsAccepted"]])
catn("numberOfTimesH0SIsRejected", result[["numberOfTimesH0SIsRejected"]])
catn("numberOfTimesFutilityDecidedAtLastLook",result[["numberOfTimesFutilityDecidedAtLastLook"]])
catn("numberOfTimesTrialEndedAtLook", result[["numberOfTimesTrialEndedAtLook"]])
catn("avgExitTime", result[["avgExitTime"]])
## End(Not run)
Given the estimates of the \pi
and \theta
, compute d
.
Description
This function computes d
via
d(\pi,\xi)=\{ \pi_0 a + (1-\pi_0)\} - \{\pi_1 abc + (1-\pi_1)b \}
Usage
computeDGivenXi(piVec, xiVec)
Arguments
piVec |
The two-element vector of |
xiVec |
The three-element vector of |
Details
This is an approximation to the hazard ratio
Value
The computed value of d
, a scalar
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.
Compute the estimate of the variance of the generalized
likelihood ratio statistic at time t
Description
This function computes the variance of the generalized likelihood ratio statistic at interim stopping times
Usage
computeGammaSubT(thetaHat, pi, interimData)
Arguments
thetaHat |
The three-element vector of |
pi |
The two-element vector of |
interimData |
The interim data at time |
Details
The function builds a hessian matrix and uses a reparametrization to
compute \Gamma_t
, the variance of the generalized likelihood
ration stochastic process at time
$t$.
Value
A scalar value of the variance \Gamma_t
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.
Given interim data, compute the response end-point summary
Description
Compute the response end-point summary for interim data. This will include the proportion of responses, the proportion of people on treatment and control etc.
Usage
computeResponseSummary(interimData)
Arguments
interimData |
The interim data for the clinical trial |
Details
The result is a vector of counts and proportions
Value
m0 |
number on control arm |
m1 |
number on treatment arm |
y0 |
number of responses in control |
y1 |
number of responses in treatment |
numberOfTotalResponses |
number of total responses in both arms |
controlRespProp |
the proportion of responders in control arm |
treatmentRespProp |
the proportion of responders in the treatment arm |
pooledProp |
the pooled response proportion |
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
## Not run:
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)
dInterim <- generateInterimData(d, trialParameters$interimLookTime[2],
trialParameters$adminCensoringTime)
computeResponseSummary(dInterim)
## End(Not run)
Given a design object, interim data and the current calendar time, conduct the interim analysis for the time
Description
This function is designed to be used in the field. Assuming a particular design is chosen, it conducts the interim analysis for a specific calendar time and provides the means for deciding whether to stop for futility or efficacy.
Usage
executeSP23Design(sp23DesignObject, data, currentCalendarTime)
Arguments
sp23DesignObject |
A seamless phase II-III design object, typically one produced by the
|
data |
The interim data, something akin to that produced by the function
|
currentCalendarTime |
The current calendar time of the interim data. This better be one of the specified interim looks, or the function stops. |
Details
This function is designed to be used in the field, although there are parts of it that are currently problematic. For example, in the field, there is typically no inkling of a responder or non-responder and yet the function as it currently stands is too wedded to the simulation scenario. Not hard to fix though.
Value
A vector of quantities is returned.
m0 |
number on control arm |
m1 |
number on treatment arm |
y0 |
number of responses in control |
y1 |
number of responses in treatment |
pi0Hat |
estimate of the proportion of responders among control |
pi1Hat |
estimate of the proportion of responders among treatment |
pi0HatH0 |
estimate of the proportion of responders among control
under |
pi1HatH0 |
estimate of the proportion of responders among control
under |
pi0HatH1 |
estimate of the proportion of responders among control
under |
pi1HatH1 |
estimate of the proportion of responders among control
under |
glrRespH0 |
estimate of the generalized likelihood ratio
statistic for response under |
glrRespH1 |
estimate of the generalized likelihood ratio
statistic for response under |
glrSurvH0 |
estimate of the generalized likelihood ratio
statistic for survival under |
glrSurvH1 |
estimate of the generalized likelihood ratio
statistic for survival under |
alphaHat |
the estimate of |
alphaHatH0 |
the estimate of |
alphaHatH1 |
the estimate of |
betaHat |
the estimate of |
betaHatH0 |
the estimate of |
betaHatH1 |
the estimate of |
gammaHat |
the estimate of |
gammaHatH0 |
the estimate of |
gammaHatH1 |
the estimate of |
hazard |
the estimate of |
v |
the estimate of |
rejectH0R |
a flag indicating if $H_0^R$ was rejected at the interim look |
acceptH0R |
a flag indicating if $H_0^R$ was accepted (futility) at the interim look |
rejectH0S |
a flag indicating if $H_0^S$ was rejected at the interim look |
acceptH0S |
a flag indicating if $H_0^S$ was accepted (futility) at the interim look |
b.metas.Last |
the last Haybittle-Peto boundary for the survival end-point, if computed |
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
## Not run:
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
sp23Design <- generateSP23Design(trueParameters, trialParameters)
d <- generateClinicalTrialData(nRec = trialParameters$numberRecruitedEachYear,
nFUp = trialParameters$followupTime,
pi0 = trueParameters$p0,
pi1 = trueParameters$p1,
theta = trueParameters$theta,
lambda0 = trueParameters$baselineLambda)
result <- executeSP23Design(sp23Design, d, trialParameters$interimLookTime[2])
## End(Not run)
Explore a specified design by simulation
Description
Explore a chosen design by generating simulated datasets and storing data from simulations for further analysis
Usage
exploreSP23Design(sp23Design, numberOfSimulations = 25, rngSeed = 12345,
showProgress = TRUE)
Arguments
sp23Design |
A design object typically created by the function |
numberOfSimulations |
The number of simulations to use, default 25 |
rngSeed |
A seed for the random number generator for reproducibility |
showProgress |
A flag (default |
Details
This function is used while exploring the characteristics of a design. Results are accumulated and can be fed into analysis functions to inform choices.
Value
A list of length numberOfSimulations
where each entry is a data
frame with number of interim looks rows and the following variables in
the column.
m0 |
number on control arm |
m1 |
number on treatment arm |
y0 |
number of responses in control |
y1 |
number of responses in treatment |
pi0Hat |
estimate of the proportion of responders among control |
pi1Hat |
estimate of the proportion of responders among treatment |
pi0HatH0 |
estimate of the proportion of responders among control
under |
pi1HatH0 |
estimate of the proportion of responders among control
under |
pi0HatH1 |
estimate of the proportion of responders among control
under |
pi1HatH1 |
estimate of the proportion of responders among control
under |
glrRespH0 |
estimate of the generalized likelihood ratio
statistic for response under |
glrRespH1 |
estimate of the generalized likelihood ratio
statistic for response under |
glrSurvH0 |
estimate of the generalized likelihood ratio
statistic for survival under |
glrSurvH1 |
estimate of the generalized likelihood ratio
statistic for survival under |
alphaHat |
the estimate of |
alphaHatH0 |
the estimate of |
alphaHatH1 |
the estimate of |
betaHat |
the estimate of |
betaHatH0 |
the estimate of |
betaHatH1 |
the estimate of |
gammaHat |
the estimate of |
gammaHatH0 |
the estimate of |
gammaHatH1 |
the estimate of |
hazard |
the estimate of |
v |
the estimate of |
rejectH0R |
a flag indicating if $H_0^R$ was rejected at the interim look |
acceptH0R |
a flag indicating if $H_0^R$ was accepted (futility) at the interim look |
rejectH0S |
a flag indicating if $H_0^S$ was rejected at the interim look |
acceptH0S |
a flag indicating if $H_0^S$ was accepted (futility) at the interim look |
b.metas.Last |
the last Haybittle-Peto boundary for the survival end-point, if computed |
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, 2011, (submitted).
Examples
## Not run:
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)
## Case C of table 1 in paper
caseC.TrueParameters <- list(p0 = 0.3,
p1 = 0.6,
pdiffHyp=0.3,
theta = list(
alpha = 0,
beta = 0,
gamma = 0),
baselineLambda = 0.35,
etaHyp = 0.25)
## Do case C as example
sp23Design <- generateSP23Design(caseC.TrueParameters, trialParameters)
trialHistory <- exploreSP23Design(sp23Design, numberOfSimulations=25, rngSeed=2387487)
## End(Not run)
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)
Generate interim data for a clinical trial from a data set.
Description
Generate interim data at a given time from a dataset
Usage
generateInterimData(clinicalTrialDF, interimTime, administrativeCensoringTime)
Arguments
clinicalTrialDF |
The data frame from which to generate the interim data. It is assumed
that the variables |
interimTime |
the interim time for which the data is to generated |
administrativeCensoringTime |
The administrative censoring time when the study concludes |
Details
As it stands this function also is geared towards the simulation scenario. Needs to be cleaned up a bit.
Value
Returns a subset of the input data frame with the following additional variables.
delta |
the event indicator |
eventTime |
calendar event time |
Furthermore, the timeToEvent
variable is appropriately
calculated
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)
dInterim <- generateInterimData(d, trialParameters$interimLookTime[2],
trialParameters$adminCensoringTime)
Generate a seamless Phase II-III design object given some the true parameters and clinical trial parameters
Description
Generate a seamless Phase II-III design object given some the true parameters and clinical trial parameters
Usage
generateSP23Design(trueParameters, trialParameters)
Arguments
trueParameters |
A list constisting of several components
including
|
trialParameters |
A list constisting of several components
including
|
Details
Generates a design object that is used throughout the simulation or an actual analysis.
Value
An informal sp23Design
object, a list of four items
trueParameters |
exactly the input above |
trialParameters |
exactly the input above |
glrBoundary |
a matrix of dimension number of interim looks by 4, containing the boundaries for futility and efficacy for both response and survival |
interimLookHistoryDF |
A data frame as described in
|
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.
See Also
exploreSP23Design
and examples in the examples
subdirectory of this package
Examples
## trial parameters in paper
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)
## Case C of table 1 in paper
caseC.TrueParameters <- list(p0 = 0.3,
p1 = 0.6,
pdiffHyp=0.3,
theta = list(
alpha = 0,
beta = 0,
gamma = 0),
baselineLambda = 0.35,
etaHyp = 0.25)
## Do case C as example
sp23Design <- generateSP23Design(caseC.TrueParameters, trialParameters)
A utility function to compute the hessian of the generalized (conditional) partial likelihood ratio statistic
Description
A utility function to compute the hessian of the generalized (conditional) partial likelihood ratio statistic
Usage
hessian(theta, pi, interimData)
Arguments
theta |
The three-element vector |
pi |
The two-element vector |
interimData |
The interim data frame |
Details
Computes the hessian
Value
A 3\times
3 matrix of the hessian
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.
Compute the response log-likelihood
Description
Compute the response log-likelihood
Usage
loglik1(piVec, respSummary)
Arguments
piVec |
The two-element vector of |
respSummary |
A vector consisting of the summary of data described in
|
Details
Computes the log-likelihood
Value
the log-likelihood
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.
Computes the constrained response log-likelihood (on the alternative)
Description
Computes the constrained response log-likelihood (on the alternative)
Usage
loglik1GivenDelta(p, respSummary, delta = 0)
Arguments
p |
The probability |
respSummary |
A vector consisting of the summary of data described in
|
delta |
The scalar value of the difference |
Details
Computes the constrained response log-likelihood (on the alternative)
Value
the (constrained) response log likelihood
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.
Computes the survival log-likelihood
Description
Computes the survival log-likelihood
Usage
loglik2(theta, interimData)
Arguments
theta |
the three-element vector of |
interimData |
The interim data |
Details
Computes the survival log-likelihood
Value
the survival log-likelihood
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.
Computes the constrained survival log-likelihood
Description
Computes the constrained survival log-likelihood
Usage
loglik2.repar0(xi, interimData, pi0, pi1, eta.hyp = 0)
Arguments
xi |
the three-element vector of |
interimData |
the interim data |
pi0 |
the value |
pi1 |
the value |
eta.hyp |
The hypothesised difference |
Details
This uses the reparametrization above in terms of (a,b,c)
rather
than (\alpha, \beta, \gamma )
Value
The constrained survival log-likelihood
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.
Compute the modified Haybittle-Peto boundary
Description
Compute the modified Haybittle-Peto boundary
Usage
mHP.b(mu = c(0, 0), v = c(1, 2), alpha = 0.05, eps = 1/2, side = c("one", "two"))
Arguments
mu |
The mean vector |
v |
The variance vector, usually proportional to information in calendar time |
alpha |
The significance desired |
eps |
The fraction of alpha to use |
side |
one-sided or two-sided ( |
Details
Compute the modified Haybittle-Peto boundary
Value
the modified Haybittle-Peto boundary
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.
Compute the modified Haybittle-Peto boundary for the final look
Description
Compute the modified Haybittle-Peto boundary for the final look
Usage
mHP.c(mu = c(0, 0, 0), v = c(1, 2, 3), b = 3, alpha = 0.05,
eps = 1/2, side = c("one", "two"))
Arguments
mu |
the mean vector |
v |
The variance vector, usually proportional to information in calendar time |
b |
The (constant) modified Haybittle-Peto boundary, typically computed
by |
alpha |
The significance level desired |
eps |
The fraction of alpha to use |
side |
one-sided or two-sided ( |
Details
Compute the modified Haybittle-Peto boundary for the final look
Value
the modified Haybittle-Peto boundary for the final look
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.
Perform an interim look in a seamless Phase II-III clinical trial
Description
Perform an interim look in a seamless Phase II-III clinical trial
Usage
performInterimLook(k, trueParameters, trialParameters, glrBoundary,
interimData, interimLookHistoryDF, argRejectH0R)
Arguments
k |
the index of the look |
trueParameters |
the true parameters, usually available in an object generated by
|
trialParameters |
the trial parameters, usually available in an object generated by
|
glrBoundary |
the generalized likelihood ratio boundaries, usually available in
an object produced by |
interimData |
the interim data |
interimLookHistoryDF |
the interim look history data frame matrix described in
|
argRejectH0R |
A flag that indicates whether |
Details
Perform an interim look in a seamless Phase II-III clinical trial
Value
a vector of named values described in
exploreSP23Design
, essentially providing a new row to
the interim look history data frame
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
sp23Design <- generateSP23Design(trueParameters, trialParameters)
d <- generateClinicalTrialData(nRec = trialParameters$numberRecruitedEachYear,
nFUp = trialParameters$followupTime,
pi0 = trueParameters$p0,
pi1 = trueParameters$p1,
theta = trueParameters$theta,
lambda0 = trueParameters$baselineLambda)
dInterim <- generateInterimData(d, trialParameters$interimLookTime[1],
trialParameters$adminCensoringTime)
dInterim <- dInterim[order(dInterim$timeToEvent), ]
## This is a tricky function to use for all but the first interim look;
## see executeSP23Design code for details! Reason: interim look k depends
## on results of interim look k-1
##
performInterimLook(1, sp23Design$trueParameters, trialParameters, sp23Design$glrBoundary,
dInterim, sp23Design$interimLookHistoryDF,
argRejectH0R = FALSE)
Reset the design object so that counts and results are zeroed out
Description
Reset the design object so that counts and results are zeroed out
Usage
resetSP23Design(sp23Design)
Arguments
sp23Design |
An object usually the result of |
Details
Reset the design object so that counts and results are zeroed out
Value
A new sp23Design
object with counts and results zeroed out
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
## Not run:
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)
## Case C of table 1 in paper
caseC.TrueParameters <- list(p0 = 0.3,
p1 = 0.6,
pdiffHyp=0.3,
theta = list(
alpha = 0,
beta = 0,
gamma = 0),
baselineLambda = 0.35,
etaHyp = 0.25)
## Do case C as example
sp23Design <- generateSP23Design(caseC.TrueParameters, trialParameters)
## do something ...
sp23Design <- resetSP23Design(sp23Design)
## End(Not run)
A convenience function to reduce dimension by solving for one variable
c
in terms of others a
, b
, d
Description
A convenience function to reduce dimension by solving for one variable
c
in terms of others a
, b
, d
Usage
solveForCGivenABD(piVec, a, b, d)
Arguments
piVec |
The two-element vector of |
a |
The value for |
b |
The value for |
d |
The value for |
Details
Just solves the equation in closed form
Value
the value for c
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.