Bayes Factors for Informative Hypotheses

Computes approximated adjusted fractional Bayes factors for equality, inequality, and about equality constrained hypotheses. S3 methods are available for specific types of lm() models, namely ANOVA, ANCOVA, and multiple regression, and for the t_test(). The statistical underpinnings are described in Gu, Mulder, and Hoijtink, (2018) , Hoijtink, Gu, and Mulder, (2018) , and Hoijtink, Gu, Mulder, and Rosseel, (2018) .



Bain is an abbreviation for BAyesian INformative hypothesis evaluation. It uses the Bayes factor to evaluate equality and inequality constraint hypotheses in a wide variety of statistical models.


You can install bain from github with:

# install.packages("devtools")
devtools::install_github("cjvanlissa/bain", args = c("--no-multiarch", "--no-test-load"))


Add bain to your existing R workflow, and obtain Bayes factors for your familiar R analyses! Bain is compatible with the pipe operator. Here is an example for testing an informative hypothesis about mean differences in an ANOVA:

# Load dplyr to access the pipe operator
iris %>%                                 # Example data
  select(Sepal.Length, Species) %>%      # Select outcome and predictor variables
  lm(Sepal.Length ~ -1 + Species, .) %>% # Add -1 to the formula to estimate group means, as in ANOVA
  bain("setosa < versicolor = virginica; setosa < versicolor < virginica")


bain 0.2.1

  • Fixed compilation error of F90 source code on r-patched-solaris-x86, by explicitly ending subroutines

bain 0.2.0

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.4 by Caspar J van Lissa, 4 months ago

Browse source code at

Authors: Xin Gu [aut] , Herbert Hoijtink [aut] , Joris Mulder [aut] , Caspar J van Lissa [aut, cre] , Van Zundert Camiel [ctb] , Jeff Jones [ctb] , Niels Waller [ctb]

Documentation:   PDF Manual  

GPL (>= 3) license

Imports lavaan

Depends on stats

Suggests MASS, testthat, knitr, rmarkdown

Depended on by BFpack, gorica.

See at CRAN