This package contains the Hierarchical Bayesian model to predict sample size for online activity. The bang package (https://cran.rstudio.com/web/packages/bang/index.html) was used and accelerated by modifying it to use sufficient statistics, and to only simulate from the posterior over the hyper-parameters.
"misc.R", "beta_prior.R", "binom_beta.R", "hef.R" and "set_and_check_prior.R" are source files from bang packages (https://cran.rstudio.com/web/packages/bang/index.html). New functions "beta_init_ests_new" and "hefnew" are added to "beta_prior.R" and "hef.R" separately.
"main.R" shows a toy example how to run the sample size prediction model.