Learn R Programming

⚠️There's a newer version (0.2.10) of this package.Take me there.

bain

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.

Installation

You can install bain from github with:

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

Workflow

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
library(dplyr)
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")

Copy Link

Version

Install

install.packages('bain')

Monthly Downloads

3,276

Version

0.2.2

License

GPL (>= 3)

Maintainer

Caspar van Lissa

Last Published

September 26th, 2019

Functions in bain (0.2.2)

flip_inequality

Flip inequality
seBeta

Standard Errors and CIs for Standardized Regression Coefficients
sesamesim

Simulated Sesame Street Data
get_estimates

Get estimates from a model object
constraint_to_equation

Constraint to equation
bain

Bayes factors for informative hypotheses
expand_parentheses

Expand parentheses
expand_compound_constraints

Expand compound constraints
constraint_to_row

Constraint to row
t_test

Student's t-test
create_matrices

Create (in)equality constraint matrices
order_terms

Order terms
label_estimates

Label estimates from a model object