Logo Utrecht University

Informative Hypotheses


Bain is an abbreviation for BAyesian INequality and equality constrained 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.


Bain was developed and is being maintained by:

Xin Gu

Department of Geography and Planning

University of Liverpool – 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

The following persons have contributed to the further development and presentation of Bain:

Marlyne Bosman

Evie Izeboud




The R package Bain can be used for the evaluation of classical and informative hypotheses using the Bayes factor. BaIn is licensed under the GNU General Public License Version >=3 The current version is Bain-0.1.0 It is a beta version, that is, there may still be errors and bugs in the package. Let us know if you find one.


CLICK HERE to obtain all Bain versions released previous to Bain-0.1.0. The first one is the Fortran90 version used in Xin Gu’s dissertation and the publication in the British Journal of Mathematical and Statistical Psychology.

CLICK HERE to obtain Bain-0.1.0, installation instructions for Windows, Mac, and Linux, and the tutorial explaining how to evaluate classical and informative hypotheses using the Bayes factor. You are well advised to read the tutorial before using Bain.

EXAMPLES OF USING BAIN IN THE CONTEXT OF VARIOUS STATISTICAL MODELS additional examples will be added in the course of 2018 and 2019. The first four items in the list will be implemented in JASP

Is your application not included in the list and you want support, send an e-mail to H.Hoijtink@uu.nl and include the model you want to use, your hypotheses, and data. You can also invite us to give a workshop based on the material covered in workshopslides.pdf

Click to download example R code and description

  1. The independent samples t-test with unequal variances per group
  2. ANOVA see also tutorial.pdf and BFTutorial.R as included in the Bain download
  4. Multiple Regression
  5. Equivalence Testing
  6. Multiple Group Logistic regression
  7. Multiple regression in the presence of missing data
  8. Repeated measures in a within between design

You can give credit to the authors of Bain by referring to:

Gu, X., Mulder, J., and Hoijtink, H. (in press). Approximate adjusted fractional Bayes factors: A general method for testing informative hypotheses. British Journal of Mathematical and Statistical Psychology. DOI: 10.1111/bmsp.12110

Hoijtink, H., Gu, X., and Mulder, J. (unpublished). Bain, multiple group Bayesian evaluation of informative hypotheses

Other important publications are:

Gu, X. (2016). Bayesian Evaluation of Informative Hypotheses. Doctoral Dissertation, University Utrecht.

Hoijtink, H., Gu, X., Mulder, J., and Rosseel, Y. (in press). Computing Bayes factors from data with missing values. Psychological Methods.