| Title: | Two-/Three-Stage Designs for Phase 1&2 Clinical Trials |
|---|---|
| Description: | Calculates Zhong's optimal two-/three-stage Phase II designs for single-arm trials, generates target-toxicity decision tables for two-/three-stage Phase I dose-finding, and supports dose-finding simulations using custom decision tables. The Phase II design is based on Zhong (2012) <doi:10.1016/j.cct.2012.07.006>. |
| Authors: | Wenchuan Guo [aut, cre], Jianan Hui [aut], Bob Zhong [aut] |
| Maintainer: | Wenchuan Guo <[email protected]> |
| License: | GPL-2 |
| Version: | 1.1-9 |
| Built: | 2026-05-26 07:58:36 UTC |
| Source: | https://github.com/cran/tsdf |
Adjust Zhong's two-stage design for over-running or under-running.
adj.two(n1, r1, s1, n2, alpha1, alpha2, beta, pc, pe, ...)adj.two(n1, r1, s1, n2, alpha1, alpha2, beta, pc, pe, ...)
n1 |
Sample size at stage 1. |
r1 |
Inefficacy boundary at stage 1. |
s1 |
Efficacy boundary at stage 1. If there is no early stopping for
efficacy, |
n2 |
Sample size at stage 2. |
alpha1 |
Left-side overall type I error. |
alpha2 |
right-side overall type I error. |
beta |
Type II error. |
pc |
A numeric vector of response rates. It should have length 1 or 2. |
pe |
Alternative hypothesis response rate. |
... |
Unused arguments. |
This function enumerates feasible second-stage boundaries after the first-stage sample size and boundaries have been fixed.
An object of class "opt.design", returned as a list
containing:
bdry |
The rejection boundaries. |
error |
The true type I and type II errors. |
n |
The sample size at each stage. |
complete |
The complete list of feasible designs. |
alpha1 |
The input left-side type I error. |
alpha2 |
The input right-side type I error. |
beta |
The input type II error. |
pc |
The input response-rate vector. |
pe |
The input alternative response rate. |
stage |
The number of stages in the selected design. |
Wenchuan Guo <[email protected]>, Jianan Hui <[email protected]>
n1 <- 22 r1 <- 6 s1 <- 22 n2 <- 24 pc <- 0.4 pe <- pc + 0.15 alpha1 <- 0.3 alpha2 <- 0.1 beta <- 0.2 out <- adj.two(n1, r1, s1, n2, alpha1, alpha2, beta, pc, pe)n1 <- 22 r1 <- 6 s1 <- 22 n2 <- 24 pc <- 0.4 pe <- pc + 0.15 alpha1 <- 0.3 alpha2 <- 0.1 beta <- 0.2 out <- adj.two(n1, r1, s1, n2, alpha1, alpha2, beta, pc, pe)
Run dose-finding simulations based on a customized decision table.
dec.sim(truep, decTable, start.level = 1, nsim = 1000)dec.sim(truep, decTable, start.level = 1, nsim = 1000)
truep |
A vector of length |
decTable |
A customized decision table in the same format as the output
of |
start.level |
Starting dose level. Defaults to 1, the lowest dose level. |
nsim |
Number of simulated trials. Defaults to 1000. |
Assume there are dose levels to be studied. Let
and denote the cumulative number of patients treated
and the cumulative number of DLTs observed at the current dose level,
respectively. Let be the maximum number of patients allowed
at each dose level. The procedure is as follows:
Update the cumulative numbers of DLTs () and
total treated patients () at the current dose, then use the
decision table to choose an action. If the decision is "S", go to
Step 2. If the decision is "D" or "DU", go to Step 3. If the
decision is "E", go to Step 4.
If , declare dose as the MTD.
Otherwise, treat an additional cohort at the current dose and return to
Step 1.
If the current dose is the lowest dose, stop the trial and
declare that the MTD is below the lowest dose. Otherwise, if the next lower
dose has not yet reached , treat an additional cohort there,
move to that dose, and return to Step 1. If the next lower dose has already
reached , stop the trial and declare that dose as the MTD. If
the decision is "DU", record the current dose as unusable and do not
treat additional patients there.
If the current dose is the highest dose, stop the trial and
declare that the MTD is above the highest dose. Otherwise, if the next
higher dose has been marked "DU", continue treating the current dose
until it reaches ; if that limit is reached, declare the
current dose as the MTD. If the next higher dose is available and has not
yet reached , treat an additional cohort there, move up to
that dose, and return to Step 1. Otherwise, declare the current dose as the
MTD.
An object of class "dec.sim". Use
summary.dec.sim to obtain and print a summary table of the
results. The returned object is a list containing:
mtd |
A vector of dose levels giving the recommended maximum tolerated dose (MTD) at the end of the trial. |
mtd.prob |
A vector of length |
over.prob |
A vector of length |
n.patients |
The average number of patients treated at each dose level. |
dlt |
The average number of DLTs observed at each dose level. |
truep |
The input true toxicity probabilities. |
start.level |
The input starting dose level. |
nsim |
The input number of simulated trials. |
Wenchuan Guo <[email protected]>
truep <- c(0.3, 0.45, 0.5, 0.6) res <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) out <- dec.sim(truep, as.matrix(res$table), start.level = 2, nsim = 1000) summary(out, pt = 0.3)truep <- c(0.3, 0.45, 0.5, 0.6) res <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) out <- dec.sim(truep, as.matrix(res$table), start.level = 2, nsim = 1000) summary(out, pt = 0.3)
Generate a two- or three-stage dose-finding decision table.
dec.table(alpha.l, alpha.r, alpha.u, pt, n, sf.param = 4, pe.par = 0.25, ...)dec.table(alpha.l, alpha.r, alpha.u, pt, n, sf.param = 4, pe.par = 0.25, ...)
alpha.l |
Left-side overall type I error. This controls the upper bound for dose escalation. |
alpha.r |
Right-side overall type I error. This controls the lower bound for dose de-escalation. |
alpha.u |
Right-side overall type I error used to determine the lower
bound for |
pt |
A numeric vector of target toxicities. It should have length 1, or length 2 when the target is an interval. |
n |
A vector of sample sizes at each stage. |
sf.param |
A single real value specifying the gamma parameter for the Hwang-Shih-DeCani spending function. The allowable range is [-40, 40]. Larger values spend more error early and leave less for later stages. Defaults to 4. |
pe.par |
Alternative hypothesis offset used to calculate power and the
type II error. The alternative is defined as |
... |
Unused arguments. |
An alpha-spending method is available for two- and three-stage
designs. dec.table uses the Hwang-Shih-DeCani spending function.
An object of class "dec.table", returned as a list
containing:
table |
The generated decision table. |
alpha.two |
A vector of true type I errors for the two-sided test. |
alpha.one |
A vector of true type I errors for the right-sided test. |
beta |
The true type II error, which depends on the alternative hypothesis. |
E |
A vector of |
D |
A vector of |
DU |
A vector of |
pt |
The input target toxicity vector. |
n |
The input stage-wise sample sizes. |
sf.param |
The input alpha-spending parameter. |
Wenchuan Guo <[email protected]>
alpha.l <- 0.6 alpha.r <- 0.4 alpha.u <- 0.1 pt <- 0.3 # Print the decision table for a 3+3+3 design n <- rep(3, 3) dec.table(alpha.l, alpha.r, alpha.u, pt, n)$table # 3+3 design n <- rep(3, 2) dec.table(alpha.l, alpha.r, alpha.u, pt, n)$tablealpha.l <- 0.6 alpha.r <- 0.4 alpha.u <- 0.1 pt <- 0.3 # Print the decision table for a 3+3+3 design n <- rep(3, 3) dec.table(alpha.l, alpha.r, alpha.u, pt, n)$table # 3+3 design n <- rep(3, 2) dec.table(alpha.l, alpha.r, alpha.u, pt, n)$table
Calculate the optimal 2- or 3-stage design proposed by Bob Zhong.
opt.design( alpha1, alpha2, beta, pc, pe, stage = 2, stop.eff = FALSE, frac_n1 = NULL, frac_n2 = NULL, sf.param = NULL, show = FALSE, nmax = 100, n.choice = 1, ... )opt.design( alpha1, alpha2, beta, pc, pe, stage = 2, stop.eff = FALSE, frac_n1 = NULL, frac_n2 = NULL, sf.param = NULL, show = FALSE, nmax = 100, n.choice = 1, ... )
alpha1 |
Left-side overall type I error. |
alpha2 |
right-side overall type I error. |
beta |
Type II error. |
pc |
A numeric vector of response rates. It should have length 1 or 2. |
pe |
Alternative hypothesis response rate. |
stage |
Either 2 or 3. Defaults to 2. |
stop.eff |
Logical; if |
frac_n1 |
Proportion range for |
frac_n2 |
Proportion range for |
sf.param |
A single real value specifying the gamma parameter for the
Hwang-Shih-DeCani spending function. The allowable range is [-40, 40].
Larger values spend more error early and leave less for later stages. For
two-stage designs, the default is |
show |
Logical; if |
nmax |
Maximum sample size. Defaults to 100. |
n.choice |
Stopping criterion for the search over feasible designs. The
search stops once the number of designs exceeds |
... |
Unused arguments. |
In the two-stage design, n1 patients are treated in the
first stage. At the end of stage 1, the trial either continues to stage 2
or stops early for inefficacy, depending on the number of observed
responses. If the trial continues, an additional n2 patients are
treated. The three-stage design extends the two-stage design by adding one
interim stage between stages 1 and 2. The left-side rejection region is
defined by response <= r_i for i = 1, 2, 3, and the
right-side rejection region is defined by response > s. An
alpha-spending method is available for both two- and three-stage designs.
opt.design uses the Hwang-Shih-DeCani spending function; you can
change the definition of HSD to use a different spending function.
An object of class "opt.design", returned as a list
containing:
bdry |
The rejection boundaries. |
error |
The true type I and type II errors. |
n |
The sample size at each stage. |
complete |
The complete list of feasible designs. |
alpha1 |
The input left-side type I error. |
alpha2 |
The input right-side type I error. |
beta |
The input type II error. |
pc |
The input response-rate vector. |
pe |
The input alternative response rate. |
sf.param |
The input alpha-spending parameter. |
stage |
The number of stages in the selected design. |
Wenchuan Guo <[email protected]>, Jianan Hui <[email protected]>
Zhong. (2012) Single-arm Phase IIA clinical trials with go/no-go decisions. Contemporary Clinical Trials, 33, 1272–1279.
alpha1 <- 0.15 alpha2 <- 0.10 beta <- 0.15 pc <- 0.25 pe <- pc + 0.20 # calculate optimal two-stage design without using alpha-spending opt.design(alpha1, alpha2, beta, pc, pe, stage=2) # calculate optimal two-stage design with Pocock-like spending function opt.design(alpha1, alpha2, beta, pc, pe, stage = 2, sf.param = 1) # calculate optimal three-stage design with an O'Brien-Fleming-like spending function opt.design(alpha1, alpha2, beta, pc, pe, stage = 3, sf.param = -4)alpha1 <- 0.15 alpha2 <- 0.10 beta <- 0.15 pc <- 0.25 pe <- pc + 0.20 # calculate optimal two-stage design without using alpha-spending opt.design(alpha1, alpha2, beta, pc, pe, stage=2) # calculate optimal two-stage design with Pocock-like spending function opt.design(alpha1, alpha2, beta, pc, pe, stage = 2, sf.param = 1) # calculate optimal three-stage design with an O'Brien-Fleming-like spending function opt.design(alpha1, alpha2, beta, pc, pe, stage = 3, sf.param = -4)
Available plot types are: true toxicity at each dose level
(type = "s"); a bar plot of the probability of selecting each dose
as the MTD (type = "prob"); a bar plot of the average number of
patients treated at each dose level (type = "np"); and a bar plot
of the average number of DLTs at each dose level (type = "dlt").
Setting type = "all" produces all four plots.
## S3 method for class 'dec.sim' plot( x, pt, s = 1, type = c("all", "s", "prob", "np", "dlt"), label = TRUE, col = "cornflowerblue", text.col = "darkblue", cex = 1, ... )## S3 method for class 'dec.sim' plot( x, pt, s = 1, type = c("all", "s", "prob", "np", "dlt"), label = TRUE, col = "cornflowerblue", text.col = "darkblue", cex = 1, ... )
x |
An object of class |
pt |
A vector of target toxicity values, one for each scenario. |
s |
The scenario to plot. Defaults to 1. |
type |
Plot type. See the description above. |
label |
Logical; if |
col |
Graphical parameter |
text.col |
Color used for text labels. |
cex |
Graphical parameter |
... |
Arguments passed to plotting functions. |
# generate decision table dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) # Simulate trials from test data test.file <- system.file("extdata", "testS.csv", package = "tsdf") out <- sl.sim(dt$table, test.file) plot(out, pt=rep(0.3,2), s=1, type="all") plot(out, pt=rep(0.3,2), s=2, type="prob") plot(out, pt=rep(0.3,2), s=1, type="np") plot(out, pt=rep(0.3,2), s=2, type="dlt")# generate decision table dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) # Simulate trials from test data test.file <- system.file("extdata", "testS.csv", package = "tsdf") out <- sl.sim(dt$table, test.file) plot(out, pt=rep(0.3,2), s=1, type="all") plot(out, pt=rep(0.3,2), s=2, type="prob") plot(out, pt=rep(0.3,2), s=1, type="np") plot(out, pt=rep(0.3,2), s=2, type="dlt")
plot method for class "dec.table".
## S3 method for class 'dec.table' plot(x, ...)## S3 method for class 'dec.table' plot(x, ...)
x |
An object of class |
... |
Unused arguments. |
plot.dec.table plots the decision boundaries.
truep <- c(0.3, 0.45, 0.5, 0.6) out <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) plot(out)truep <- c(0.3, 0.45, 0.5, 0.6) out <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) plot(out)
print method for class "dec.table".
## S3 method for class 'dec.table' print(x, ...)## S3 method for class 'dec.table' print(x, ...)
x |
An object of class |
... |
Unused arguments. |
print.dec.table prints the decision table together with a
legend.
print(dec.table(0.6,0.4,0.2,0.3,c(3,3,3)))print(dec.table(0.6,0.4,0.2,0.3,c(3,3,3)))
print method for class "opt.design".
## S3 method for class 'opt.design' print(x, ...)## S3 method for class 'opt.design' print(x, ...)
x |
An object of class |
... |
Unused arguments. |
alpha1 <- 0.20 alpha2 <- 0.1 beta <- 0.20 pc <- 0.5 pt <- pc + 0.2 out <- opt.design(alpha1, alpha2, beta, pc, pt, stage = 2, sf.param = 1) print(out)alpha1 <- 0.20 alpha2 <- 0.1 beta <- 0.20 pc <- 0.5 pt <- pc + 0.2 out <- opt.design(alpha1, alpha2, beta, pc, pt, stage = 2, sf.param = 1) print(out)
Run dose-finding simulations based on a customized decision table for one or more scenarios read from a file.
sl.sim(decTable, file, header = TRUE, sep = ",", ...)sl.sim(decTable, file, header = TRUE, sep = ",", ...)
decTable |
A customized decision table in the same format as the output
of |
file |
The name of the file containing the scenario definitions. See
|
header |
Logical; if |
sep |
The field separator character. Defaults to |
... |
Additional arguments passed to |
In each row of the input file, the parameters must be ordered as
start.level, nsim, and truep. The
dose-finding algorithm is described in dec.sim.
An object of class "dec.sim" (for one scenario) or
"sl.sim" (for multiple scenarios). Use summary to
obtain and print a summary of the results. The returned object is a list
containing:
mtd |
A vector of dose levels giving the recommended maximum tolerated dose (MTD) at the end of each trial. |
n.patients |
The average number of patients treated at each dose level. |
truep |
The input true toxicity probabilities. |
start.level |
The input starting dose level. |
nsim |
The input number of simulated trials. |
Wenchuan Guo <[email protected]>
dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) test.file <- system.file("extdata", "testS.csv", package = "tsdf") # use a customized decision table table.file <- system.file("extdata", "decTable.csv", package = "tsdf") dec <- read.csv(table.file, row.names = 1, check.names = FALSE) out1 <- sl.sim(as.matrix(dt$table), test.file) out2 <- sl.sim(dec, test.file)dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) test.file <- system.file("extdata", "testS.csv", package = "tsdf") # use a customized decision table table.file <- system.file("extdata", "decTable.csv", package = "tsdf") dec <- read.csv(table.file, row.names = 1, check.names = FALSE) out1 <- sl.sim(as.matrix(dt$table), test.file) out2 <- sl.sim(dec, test.file)
summary method for class "dec.sim".
## S3 method for class 'dec.sim' summary(object, pt, ...)## S3 method for class 'dec.sim' summary(object, pt, ...)
object |
An object of class |
pt |
Target toxicity for each scenario. |
... |
Unused arguments. |
summary formats key statistics from dose-finding
simulations. Given the target toxicity, it reports the probability of
selecting each dose level as the MTD, the probability of selecting doses
above the true MTD, the probability of selecting the true MTD, and the
probability that subjects are treated at or below the true MTD. The true
MTD is defined as the highest dose level with toxicity probability less
than or equal to the target toxicity. If the target is below the smallest
toxicity probability, the lowest dose level is treated as the MTD. For
example, if the target is 0.3 and the true toxicity probabilities for five
doses are 0.1, 0.25, 0.35, 0.40, and 0.50, then the MTD is dose 2.
test.file <- system.file("extdata", "testS.csv", package = "tsdf") dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) out <- sl.sim(dt$table, test.file) pt <- c(0.3, 0.4) summary(out, pt)test.file <- system.file("extdata", "testS.csv", package = "tsdf") dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3)) out <- sl.sim(dt$table, test.file) pt <- c(0.3, 0.4) summary(out, pt)