Description Usage Arguments See Also Examples
View source: R/binom_one_power_v1.0.R
Computes the power of a given trial design given the probability of success of treatment p.
1 2 3 4 5 6 7 8 | binom_one_power(p,failure,success,n)
plot_binom_one_power(failure, success, n, ndivisions=1000,
xlim=c(0,1), xaxs="i", yaxs="i", ylim=c(0,1.1),
main="Power curve for a single arm binomial trial design",
xlab="Probability of successful treatment",
ylab="Probability of successful trial",
p=NULL, alpha=NULL, power=NULL, col.error="red", ...)
|
p |
Probability of success to compute power for |
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 |
ndivisions |
The number of points calculated for the plot |
col.error |
Colour of type II errors in the plot |
alpha, power |
Plotted as lines if provided |
xlim, ylim, xaxs, yaxs, main, xlab, ylab |
Different defaults for plotting parameters |
... |
Additional plotting parameters to pass to plot function |
binom_one_alpha
, binom_one_assurance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Simon's two stage design
failure=c(0,3)
success=c(NA,4)
n=c(7,18)
p0=0.1
p1=0.3
# power
binom_one_power(p1,failure,success,n)
# type 1 error (alpha)
binom_one_power(p0,failure,success,n)
# plot
plot_binom_one_power(failure,success,n,ndivisions=1000,p=c(p0,p1),
alpha=0.1,power=0.8)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.