R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(EurosarcBayes)
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
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EurosarcBayes/binom_one_assurance.Rd_%03d_medium.png", width=480, height=480)
> ### Name: binom_one_assurance
> ### Title: Single arm, assurance calculator for single or multi-stage
> ### binomial trials.
> ### Aliases: binom_one_assurance plot_binomassurance
>
> ### ** Examples
>
> # 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)
[1] 0.38488
>
> # 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")
[1] 0.7438106
>
> # plot
> plot_binomassurance(failure,success,n,ass.dist,type="discrete",
+ ndivisions=1000)
>
>
>
>
>
> dev.off()
null device
1
>