plotBDP2 {BDP2}  R Documentation 
Plots
Description
Output of desired plots
Usage
plotBDP2(x = c("n", "k", "ptrue", "cE", "cF"),
y = c("Prob0Successes", "PostProb0or1Successes", "bFbE",
"PEcall_p0_p1", "PEstop_p0_p1",
"PFstopEcall", "PFstopEstop",
"PEcall", "PEstop", "PFstop", "PFstopEstop",
"ExpectedNumber",
"PredictivePower"),
n, interim.at, ptrue,
pF, cF, pE, cE, p0, p1, Estop=FALSE,
shape1F, shape2F, shape1E = NULL, shape2E = NULL,
col = c("green", "red"), cex.legend=1, add = FALSE,
show=TRUE, progress = FALSE, ...)
Arguments
x 
character string specifying what is given by the x axis
"n" for number of patients at final or at first interim, depending on plot
"ptrue" for the true response rate
"k" number of successes at interim (only for y=="PredictivePower" )
"cE" for the critical level of posterior probabilities used for declaring efficacy
"cF" for the critical level of posterior probabilities used for declaring futility

y 
character string specifying what is given by the y axis
"Prob0Successes" for plot of probability of 0 successes out of n at first interim, i.e. (1p)^n. Two curves are generated: one for p0 and one for p1. Choose x="n" and set n to a vector of number patients at first interim.
"PostProb0or1Successes" generates two curves of posterior probability that reponse rate exceeds cF. One given 0 successes and one given 1 success observed in n, i.e. P(p>pF 0 successes out of n) and P(p>pF 1 success out of n). Choose x="n" and set n to a vector of number patients at first interim.
"bFbE" for plot of boundaries for futility bF and for efficacy bE in terms of number of successes per n number of patients. Futility stop if number of successes <= bF, call efficacy if number of successes >= bE. Choose x="n" and set n to the maximal number of patients (not a vector).
"PEcall_p0_p1" for plot of probability to call efficacy at final (i.e. P(p>pEData)>=cE ), evaluated for data generated with control response rate p0 (corresponds to type I error) and for data generated with target response rate p1 (corresponds to power) for varying number of patients at final. Choose x="n" and set n to a vector of number patients at final.
"PEstop_p0_p1" as above but with stopping for efficacy instead of calling efficacy
"PFstopEcall" for plotting operating characteristics for a given response rate as a function of number of patients at final, n. Shows one curve (default: in red) for the probability of stopping for futility up to final analysis and one curve (default: in green) for the probability of calling efficacy at final analysis. For the setting ptrue=p0, the curves show the probability of true stopping (default: in red) and type I error (default: in green). For the setting ptrue=p1, the curves show the probability of false stopping (default: in red) and power (default: in green). Choose x="n" and set n to a vector of number patients at final.
"PFstopEstop" as above but with stopping for efficacy instead of calling efficacy
"PEcall" for plot of probability to call efficacy at final (i.e. P(p>pEData)>=cE ).
For x="ptrue" then this is the power function.
For x="cE" this gives plots of probability to call efficacy at final, evaluated for data generated with control response rate p0 (corresponds to type I error) and for data generated with target response rate p1 (corresponds to power).
"PEstop"
For x="ptrue" then this is the power function.
For x="cE" this gives plots of probability to call efficacy at final, evaluated for data generated with control response rate p0 (corresponds to type I error) and for data generated with target response rate p1 (corresponds to power).
"PFstop" for plot of cumulative probability to stop for futility up to final.
For x="ptrue" this gives the futility stopping probability as function of ptrue.
For x="cF" this gives 2 curves, evaluated for data generated with control response rate p0 (corresponds to true stopping probability, default: in green) and for data generated with target response rate p1 (corresponds to false stopping probability, default: in red).
"ExpectedNumber" for expected number of patients in the trial. Choose x= "ptrue".
Takes stopping for efficacy into account if Estop==TRUE
"PredictivePower" for predictive power (only for x=="k" )

n 
sample size at the final analysis, vector if x=="n"

interim.at 
vector of sample sizes at the interim analyses

ptrue 
true (assumed) response rate used for simulating the trial, vector if x=="ptrue"

pF 
response rate used for the futility criterion P(p>pFData) < cF (may be identical to pE)

cF 
critical level of posterior probabilities used for declaring futility, vector if x=="cF"

pE 
response rate used for the efficacy criterion P(p>pEData) >= cE

cE 
critical level of posterior probabilities used for declaring efficacy, vector if x=="cE"

p0 
response rate corresponding to H0

p1 
response rate corresponding to H1 (p1 > p0)

shape1F 
first parameter of the Beta prior for futility analysis

shape2F 
second parameter of the Beta prior for futility analysis

shape1E 
first parameter of the Beta prior for efficacy analysis

shape2E 
second parameter of the Beta prior for efficacy analysis

Estop 
Stop for efficacy? Defaults to FALSE . Only relevant if y=="ExpectedNumber" .

col 
line color, for some plots vector of length 2.

add 
add line to existing plot. Only supported if x=="ptrue"

show 
show plot (otherwise computed objects are invisibly returned)

progress 
only used by shiny app

cex.legend 
size of legend text relative to cex

... 
additional arguments passed to plot.default()

References
KoppSchneider, A., Wiesenfarth, M., Witt, R., Edelmann, D., Witt, O. and Abel, U. (2018).
Monitoring futility and efficacy in phase II trials with Bayesian
posterior distributions  a calibration approach.
Biometrical Journal, to appear.
Examples
# See vignette for more details and examples
pF=0.3
pE=0.12
shape1F=0.3
shape2F=0.7
shape1E=0.12
shape2E=0.88
cF=0.01
cE=0.9
nvec=c(18:40)
interim.at=c(10,20,30)
# Type I error and probability of true stopping for the uninteresting response rate.
ptrue=0.12
plotBDP2(x="n", y="PFstopEcall",
n =nvec, interim.at = interim.at,
pF=pF,cF=cF,pE=pE,cE=cE,ptrue=ptrue,
shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E)
# Power and probability of false stopping for the target response rate.
ptrue=0.3
plotBDP2(x="n", y="PFstopEcall",
n =nvec, interim.at = interim.at,
pF=pF,cF=cF,pE=pE,cE=cE,ptrue=ptrue,
shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E)
[Package
BDP2 version 0.1.3
Index]