Bayesian Assurance Computation.
bayesassurance R package
This R package offers a constructive set of simulation-based functions used for determining sample size and assurance in various settings. We hope these functions will be useful for addressing a wide range of clinical trial study design problems.
Setup Instructions
To install the bayesassurance
package in R, there are several ways to compile the package from source as the package is not yet available on CRAN.
Directly From Github (Mac/Windows)
- Open R Studio.
- Make sure
devtools
is installed and loaded. If not, runinstall.packages("devtools")
and load the package usinglibrary(devtools)
once installation is complete. - Install the bayesassurance package directly through Github by running
devtools::install_github("jpan928/bayesassurance_rpackage")
. You may be asked to install Rtools on a Windows machine. - If prompted with "These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?", type "1" and press Enter.
- Load package using
library(bayesassurance)
and start using package normally.
Using tar.gz
File
Alternatively, you can build the package using the tar.gz file.
Mac
Within R Studio
- Download the
bayesassurance_0.1.0.tar.gz
file. - Open R Studio.
- In the R prompt, navigate to where this file is stored using
setwd("your/filepath/here")
. - Run
install.packages("bayesassurance_0.1.0.tar.gz", repos = NULL, type = "source")
. - Load package using
library(bayesassurance)
and start using package normally.
Windows
Within R Studio
- Download the
bayesassurance_0.1.0.tar.gz
file. - Open R Studio.
- In the R prompt, navigate to where this file is stored using
setwd("your/filepath/here")
. - Run
install.packages("bayesassurance_0.1.0.tar.gz", repos = NULL, type = "source")
. You may be asked to install Rtools. - Load package using
library(bayesassurance)
and start using package normally.
Within Command Prompt
- Download the
bayesassurance_0.1.0.tar.gz
file. - Open command prompt.
- Identify path of the folder to where R is installed and run
PATH <your/filepath/here>
. An example of this file path is C:\Program Files\R\R-4.1.3\bin\x64. - On the same command prompt, navigate to the directory containing
bayesassurance_0.1.0.tar.gz
. - Enter
R CMD INSTALL bayesassurance_0.1.0.tar.gz
to install the package. - Open R Studio and run
library(bayesassurance)
and start using package normally.
Replication Materials
For JSS reviewers, R scripts containing the necessary code to reproduce figures and examples in the manuscript can be found under Replication_Material
. Please refer to the main script file, replication_script.R
, and work through the examples in chronological order. The script includes all worked out examples and figures in the order in which they appear in the manuscript. It will also point you to the supplementary R Markdown files (fig7_replication.Rmd
, fig9_replication.Rmd
, and fig10_replication.Rmd
) where appropriate.
Vignettes
Vignettes are currently undergoing revisions and will be available soon.