# \donttest{
### Single-agent trial ###
## Get the operating characteristics for a Keyboard single-agent trial
oc <- get.oc.kb(target=0.3, p.true=c(0.05, 0.15, 0.3, 0.45, 0.6),
ncohort=10, cohortsize=3, ntrial=1000)
summary_kb(oc)
plot_kb(oc)
plot_kb(oc$selpercent)
plot_kb(oc$npatients)
plot_kb(oc$ntox)
## Select the MTD based on a trial's data
n <- c(3, 3, 15, 9, 0)
y <- c(0, 0, 4, 4, 0)
selmtd <- select.mtd.kb(target=0.3, npts=n, ntox=y)
summary_kb(selmtd)
plot_kb(selmtd)
### Drug-combination trial ###
## Get the operating characteristics for a Keyboard drug-combination trial
p.true <- matrix(c(0.01, 0.03, 0.10, 0.20, 0.30,
0.03, 0.05, 0.15, 0.30, 0.60,
0.08, 0.10, 0.30, 0.60, 0.75), byrow=TRUE, ncol=5)
oc.comb <- get.oc.comb.kb(target=0.3, p.true=p.true, ncohort=20,
cohortsize=3, n.earlystop=12, startdose=c(1, 1), ntrial=100)
summary_kb(oc.comb)
plot_kb(oc.comb) # use previous plot or next plot button to switch plots
plot_kb(oc.comb$selpercent)
plot_kb(oc.comb$nptsdose)
plot_kb(oc.comb$ntoxdose)
## Select the MTD based on a trial's data
n <- matrix(c(3, 5, 0, 0, 0,
7, 6, 15, 0, 0,
0, 0, 4, 0, 0), ncol=5, byrow=TRUE)
y <- matrix(c(0, 1, 0, 0, 0,
1, 1, 4, 0, 0,
0, 0, 2, 0, 0), ncol=5, byrow=TRUE)
sel.comb <- select.mtd.comb.kb(target=0.3, npts=n, ntox=y)
summary_kb(sel.comb)
plot_kb(sel.comb)
### oc.obd.kb
toxicity.low <- 0.15
toxicity.moderate <- 0.33
toxicity.high <- 0.40
efficacy.low <- 0.20
efficacy.moderate <- 0.40
efficacy.high <- 0.60
target.toxicity <- 0.30
target.efficacy <- 0.40
p.true <-c(0.08,0.30,0.60,0.80)
q.true <- c(0.25,0.40,0.25,0.50)
oc.obd.kb <- get.oc.obd.kb(toxicity.low = toxicity.low,
toxicity.moderate= toxicity.moderate,
toxicity.high = toxicity.high,
efficacy.low = efficacy.low,
efficacy.moderate = efficacy.moderate,
efficacy.high = efficacy.high,
target.toxicity=target.toxicity,
target.efficacy= target.efficacy,
p.true= p.true, q.true= q.true)
summary_kb(oc.obd.kb)
plot_kb(oc.obd.kb)
plot_kb(oc.obd.kb$selpercent1)
plot_kb(oc.obd.kb$selpercent2)
plot_kb(oc.obd.kb$selpercent3)
plot_kb(oc.obd.kb$npatients)
plot_kb(oc.obd.kb$ntox)
plot_kb(oc.obd.kb$neff)
# }
Run the code above in your browser using DataLab