In this paper, we present bayesassurance, an R package designed for computing Bayesian assurance criteria which can be used to determine sample size in Bayesian inference setting. The functions included in the R package offer a two-stage framework using design priors to specify the population from which the data will be collected and analysis priors to fit a Bayesian model. We also demonstrate that frequentist sample size calculations are exactly reproduced as special cases of evaluating Bayesian assurance functions using appropriately specified priors.
Supplementary materials are available in addition to this article. It can be downloaded at RJ-2023-066.zip
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Pan & Banerjee, "bayesassurance: An R Package for Calculating Sample Size and Bayesian Assurance", The R Journal, 2023
BibTeX citation
@article{RJ-2023-066, author = {Pan, Jane and Banerjee, Sudipto}, title = {bayesassurance: An R Package for Calculating Sample Size and Bayesian Assurance}, journal = {The R Journal}, year = {2023}, note = {https://doi.org/10.32614/RJ-2023-066}, doi = {10.32614/RJ-2023-066}, volume = {15}, issue = {3}, issn = {2073-4859}, pages = {138-158} }