bain is an abbreviation for BAyesian INformative hypothesis evaluation. It uses the Bayes factor to evaluate hypotheses in a wide variety of statistical models. One example are the hypotheses H1: m1 = m2 = m3, H2: m1 > m2 > m3, and Hu: m1, m2, m3 (no constraints) where m1, m2, and m3 denote the means in an ANOVA model. Another example is the hypothesis H1: b1 > 0, b2 > 0, b1 > b2 and its complement Hc: not H1, where b1 and b2 denote standardized regression coefficients.
There is a bug in bain 0.2.4. When formulating hypotheses like 0.5 * theta1 > 0.8 * theta2, that is, pre-multiplying a parameter by a constant, use 0.5 and not .5 and use 0.8 and not .8, that is, the pre-multiplying constant has to start with a number and not with the decimal point. This has been corrected in bain 0.2.5 and later.
bain was developed and is being maintained by
Xin Gu – Department of Educational Psychology – East China Normal University – GuXin57@hotmail.com
Herbert Hoijtink – Department of Methodology and Statistics – Utrecht University – H.Hoijtink@uu.nl
Joris Mulder – Department of Methodology and Statistics – Tilburg University – J.Mulder3@uvt.nl
Caspar van Lissa – Department of Methodology and Statistics – Utrecht University – C.J.vanLissa@uu.nl
The following persons have contributed to the further development of bain: Marlyne Bosman and Camiel van Zundert and Qianrao Fu and Fayette Klaassen
bain is licensed under the GNU General Public License Version >=3. The latest version is bain 0.2.6. bain can be downloaded from CRAN (if you use Rstudio, go to the tab Tools – Install Packages). Note that a part of bain is implemented in JASP
Hoijtink, H., Mulder, J., van Lissa, C., and Gu, X. (2019). A tutorial on testing hypotheses using the Bayes factor. Psychological Methods, 24, 539-556. DOI: 10.1037/met0000201 CLICK HERE to obtain BFTutorial.pdf, BFTutorial.R (using the named-object input to bain which shows some of its inner workings), EasyBFTutorial.R (using the lm-object input to bain which is easy to use) and corresponding data sets. Also consult the vignette included with the R package bain for further instructions and examples.
Teacher’s Corner: Evaluating Informative Hypotheses Using the Bayes Factor in Structural Equation Models. CLICK HERE to download Van Lissa, C., Gu, X., Mulder, J., Rosseel, Y., van Zundert, C. and Hoijtink, H. (2020), Structural Equation Modelling, 28, 292-301. The examples discussed in this tutorial are contained in the vignette included with the R package bain.
Sample Size Determination
Sample size determination for the Bayesian t-test and Welch’s test. CLICK HERE to download Fu, Q., Hoijtink, H., and Moerbeek, M. (2021), Behavior Research Methods, 53, 139–152 . DOI: 10.3758/s13428-020-01408-1
Fu, Q. (2022). Sample Size Determination for Bayesian Informative Hypothesis Testing. Dissertation, Utrecht University. CLICK HERE to download.
Applications Based on bain
Bosman, M. and Hoijtink, H. (unpublished). Robust Bayes factors for Bayesian Anova: overcoming overcoming adverse effect of non-normality and outliers. CLICK HERE to obtain this paper.
Statistical Underpinnings of bain
Gu, X., Mulder, J., and Hoijtink, H. (2018). Approximate adjusted fractional Bayes factors: A general method for testing informative hypotheses. British Journal of Mathematical and Statistical Psychology, 71, 229-261. DOI: 10.1111/bmsp.12110 CLICK HERE to obtain this paper.
Gu, X., Hoijtink, H., Mulder, J., and Rosseel, Y. (2019). Bain: A program for Bayesian testing of order constrained hypotheses in structural equation models, Journal of Statistical Computation and Simulation, 89, 1526 – 1553. https://doi.org/10.1080/00949655.2019.1590574 CLICK HERE to obtain this paper.
Hoijtink, H., Gu, X., and Mulder, J. (2019). Bayesian evaluation of informative hypotheses for multiple populations. British Journal of Mathematical and Statistical Psychology, 72, 219-243. DOI: 10.1111/bmsp.12145 CLICK HERE to obtain this paper.
Hoijtink, H., Gu, X., Mulder, J., and Rosseel, Y. (2019). Computing Bayes Factors from Data with Missing Values. Psychological Methods, 24, 253-268. DOI: 10.1037/met0000187 CLICK HERE to obtain the paper
NEW: Prior Sensitivity of Null Hypothesis Bayesian Testing. Hoijtink, H. (2021). Psychological Methods. DOI: 10.1037/met0000292 CLICK HERE to download R code and paper.
If you are interested in workshop tailored to you and your group, please contact us at email@example.com, and we will inform you about the possibilities.
EARA – Digital Course, December 10th, 2021 – Click HERE to download the course materials. You can choose to do the lab meeting with JASP or R. Dowload JASP, or, RStudio and R, on your laptop before attending the course. Note that, the course materials contain R course (takes a couple of hours).
Kurt Lewin Institute – Digital Course, fall 2023 – CLICK HERE to download the course materials.
Utrecht University Summer School Course August 2021: A gentle introduction to Bayesian Statistics
SMiP, Mannheim 2-3 December 2021. To download the course materials CLICK HERE. Install de course materials in a folder on your laptop. Bring the laptop to the workshop with R, RStudio, and bain (in RStudio go to – tools – install packages) installed. Alternatively, you can work with JASP.
EMLAR2023 – Bayesian Hypothesis Evaluation using JASP. CLICK HERE download the presentation and materials for the hands-on for this tutorial. Do not forget to install JASP before attending the tutorial.
Winter School: Bayesian Hypothesis Evaluation using JASP, January, 31th, 2023. To download the course materials CLICK HERE. Install de course materials in a folder on your laptop. Bring the laptop to the workshop with JASP installed. Alternatively, you can work with R, RStudio, and bain/restriktor (in RStudio go to – tools – install packages).
EAM2023 Gent. To download the course materials CLICK HERE. Install de course materials in a folder on your laptop. Bring the laptop to the workshop with R, RStudio, and bain (in RStudio go to – tools – install packages) installed. Alternatively, you can work with JASP.