binom_one_power: Single arm, power calculator for single or multi-stage...

Description Usage Arguments See Also Examples

View source: R/binom_one_power_v1.0.R

Description

Computes the power of a given trial design given the probability of success of treatment p.

Usage

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", ...)

Arguments

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

See Also

binom_one_alpha, binom_one_assurance

Examples

 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)

Example output

Loading required package: shiny
Loading required package: VGAM
Loading required package: stats4
Loading required package: splines
Loading required package: data.table
Loading required package: plyr
Loading required package: clinfun
[1] 0.8000011
[1] 0.08933172

EurosarcBayes documentation built on May 2, 2019, 9:20 a.m.