Learn R Programming

BFF

Bayes Factor Functions

This package provides the Bayes Factor values for different effect sizes from 0 to 1. A small effect size is usually considered from 0.2 to 0.5, medium effect sizes from 0.5 to 0.8, and large effect sizes as greater than 0.8.

Using this package is very similar to using the familiar t, z, chi^2, and F tests in R. You will need the same information - the test statistic, degrees of freedom, and sample size. A graph is produced that shows the BFF curve over the different effect sizes.

For evaluating evidence from multiple studies (see 'Bayes factor functions', 2023 (arxiv)), the parameter 'r' can also be set. The default value for r is 1, but 'r' can be suggested that maximizes the bayes factor at each tau by setting the 'maximization' argument in each test to "TRUE."

Installation

The R package 'BFF' is available from CRAN, use the commands below to install the most recent Github version.

# Plain installation
devtools::install_github("rshudde/BFF") # BFF package

Example

library(BFF)

z_BFF_one = z_test_BFF(z_stat = 2.5, n = 50) #one sample z-test
z_BFF_two = z_test_BFF(z_stat = 2.5, one_sample = FALSE, n1 = 50, n2 = 50) #two sample z-test

plot(z_BFF_two) #to view the plot of BFF vs the maximized omega (here for the two sample z-test)

Copy Link

Version

Install

install.packages('BFF')

Monthly Downloads

242

Version

4.5.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Rachael Shudde

Last Published

November 6th, 2025

Functions in BFF (4.5.0)

is.BFF

Check whether x is a BFF object
t_test_BFF_invm

t_test_BFF_invm
nlnm

Non-local Normal Moment Distribution
z_test_BFF

z_test_BFF
posterior_plot

Plot Prior and Posterior Distribution
f_test_BFF

f_test_BFF
plot.BFF

Plot Bayes Factor Function
print.BFF

Summarize BFF object
chi2_test_BFF

chi2_test_BFF
BFF.object

BFF Object
regression_test_BFF

regression_test_BFF
BFF-package

BFF: Bayes Factor Functions
summary.BFF

Summarize BFF object
t_test_BFF

t_test_BFF