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

 Caspar van Lissa

Camiel van Zundert

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.1 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.2.

CLICK HERE to obtain Bain-0.1.2, installation instructions for Windows, Mac, and Linux, UNDER R-3.5.x 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. CHANGED WITH RESPECT TO Bain-0.1.1: THE DEPENDENCY ON THE FUNGIBLE PACKAGE HAS BEEN REMOVED.

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

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 when the Data Contain Missing Values
  8. Repeated Measures in a Within Between Design
  9. Robust ANOVA  by Marlyne Bosman

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

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

Hoijtink, H., Gu, X., and Mulder, J. (British Journal of Mathematical and Statistical Psychology). Bayesian Evaluation of Informative Hypotheses for Multiple Populations. With here the Online supplementary materials

Gu, X., Hoijtink, H., Mulder, J., and Rosseel, Y. (unpublished). Bain: A program for Bayesian testing of order constrained hypotheses in structural equation
models. With here the Paper and Online Supplementary Materials

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. DOI: 10.1037/met0000187  Online Supplementary Materials (BASED ON BAIN-0.1.0!!)


Faculty of Social and Behavioral Sciences, Utrecht University, Februari and April. BFTutorial

Utrecht Summer School Course on Theory Based Hypothesis Evaluation Using the P-value, Bayes Factor, and Information Criteria. July 8-11, 2019. 

If you are interested in workshop tailored to you and your group, please contact us at h.hoijtink@uu.nl, and we will inform you about the possibilities.