Description Usage Arguments See Also Examples
View source: R/binom_one_assurance_v1.0.R
Computes the assurance of a given trial design given a prior assurance distribution.
1 2 3 4 5 6 7 8 | binom_one_assurance(failure, success, n, ass.dist,
type="continuous", lower=0, upper=1, ...)
plot_binomassurance(failure, success, n, ass.dist,type="continuous",
ndivisions=1000, xlim=c(0,1), xaxs="i", yaxs="i", ylim=NULL,
main="Assurance distribution", col="red", col.fill="green", lwd=2,
xlab="Probability of successful treatment",
ylab="Prior assurance probability" ,...)
|
failure |
A vector of the number of failures required to stop for futility, if not able to stop NA or a character string should be provided |
success |
A vector of the number of successes required to stop for efficacy, if not able to stop NA or a character string should be provided |
n |
A vector of the total number of patients to recruit up to each stage of the trial |
ass.dist |
Distribution of prior probability for assurance. May be different to prior information. |
type |
Tells the program you are passing it a continuous distribution ("continuous") or a discrete distribution ("discrete") for the assurance distribution |
ndivisions |
The number of points calculated for the plot |
lower, upper |
Range of the distribution to use |
col.fill |
Colour of the true positive results in the graph |
xlim, xaxs, yaxs, ylim, main, col, lwd, xlab, ylab |
Different defaults for plotting parameters |
... |
Additional plotting parameters to pass to plot function |
binom_one_power
, binom_one_alpha
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Simon's two stage design
failure=c(0,3)
success=c(NA,4)
n=c(7,18)
p0=0.1
p1=0.3
# continuous assurance distribution
ass.dist = function(p) dbeta(p,4,18)
# assurance
binom_one_assurance(failure,success,n,ass.dist)
# plot
plot_binomassurance(failure,success,n,ass.dist,ndivisions=1000)
# discrete assurance distribution
ass.dist = matrix(c(0.2,0.3,0.4,0.3,0.4,0.3),ncol=2)
# assurance
binom_one_assurance(failure,success,n,ass.dist,type="discrete")
# plot
plot_binomassurance(failure,success,n,ass.dist,type="discrete",
ndivisions=1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.