Package: BFpack 1.6.1

Joris Mulder

BFpack: Flexible Bayes Factor Testing of Scientific Expectations

Implementation of default Bayes factors for testing statistical hypotheses under various statistical models. The package is intended for applied quantitative researchers in the social and behavioral sciences, medical research, and related fields. The Bayes factor tests can be executed for statistical models such as univariate and multivariate normal linear models, correlation analysis, generalized linear models, special cases of linear mixed models, survival models, relational event models. Parameters that can be tested are location parameters (e.g., group means, regression coefficients), variances (e.g., group variances), and measures of association (e.g,. polychoric/polyserial/biserial/tetrachoric/product moments correlations), among others. Relevant references on the methodology The statistical underpinnings are described in O'Hagan (1995) <doi:10.1111/j.2517-6161.1995.tb02017.x>, Mulder and Xin (2022) <doi:10.1080/00273171.2021.1904809>, Mulder and Gelissen (2019) <doi:10.1080/02664763.2021.1992360>, Mulder and Fox (2019) <doi:10.1214/18-BA1115>, Boeing-Messing, van Assen, Hofman, Hoijtink, and Mulder (2017) <doi:10.1037/met0000116>, Hoijtink, Mulder, van Lissa, and Gu (2018) <doi:10.1037/met0000201>, Gu, Mulder, and Hoijtink (2018) <doi:10.1111/bmsp.12110>, Hoijtink, Gu, and Mulder (2018) <doi:10.1111/bmsp.12145>, and Hoijtink, Gu, Mulder, and Rosseel (2018) <doi:10.1037/met0000187>. When using the packages, please refer to the package Mulder et al. (2021) <doi:10.18637/jss.v100.i18> and the relevant methodological papers.

Authors:Joris Mulder [aut, cre], Caspar van Lissa [aut, ctb], Donald R. Williams [aut, ctb], Xin Gu [aut, ctb], Anton Olsson-Collentine [aut, ctb], Florian Boeing-Messing [aut, ctb], Jean-Paul Fox [aut, ctb], Janosch Menke [ctb], Robbie van Aert [ctb], Barry Brown [ctb], James Lovato [ctb], Kathy Russell [ctb], Lapack 3.8 [ctb], Jack Dongarra [ctb], Jim Bunch [ctb], Cleve Moler [ctb], Gilbert Stewart [ctb], John Burkandt [ctb], Ashwith Rego [ctb], Alexander Godunov [ctb], Alan Miller [ctb], Jean-Pierre Moreau [ctb], The R Core Team [cph]

BFpack_1.6.1.tar.gz
BFpack_1.6.1.zip(r-4.7-x86_64)BFpack_1.6.1.zip(r-4.7-arm64)BFpack_1.6.1.zip(r-4.6-x86_64)BFpack_1.6.1.zip(r-4.6-arm64)BFpack_1.6.1.zip(r-4.5-x86_64)
BFpack_1.6.1.tgz(r-4.6-x86_64)BFpack_1.6.1.tgz(r-4.6-arm64)BFpack_1.6.1.tgz(r-4.5-x86_64)BFpack_1.6.1.tgz(r-4.5-arm64)
BFpack_1.6.1.tar.gz(r-4.7-arm64)BFpack_1.6.1.tar.gz(r-4.7-x86_64)BFpack_1.6.1.tar.gz(r-4.6-arm64)BFpack_1.6.1.tar.gz(r-4.6-x86_64)
BFpack_1.6.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
BFpack/json (API)

# Install 'BFpack' in R:
install.packages('BFpack', repos = c('https://jomulder.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/jomulder/bfpack/issues

Uses libs:
  • openblas– Optimized BLAS
  • fortran– Runtime library for GNU Fortran applications
Datasets:
  • actors - Actors from a small hypothetical network
  • attention - Multiple Sources of Attentional Dysfunction in Adults With Tourette's Syndrome
  • Fcor - Student t approximations of Fisher transformed correlations
  • fmri - FMRI data
  • memory - Memory data on health and schizophrenic patients
  • relevents - A sequence of innovation-related e-mail messages
  • same_culture - Same culture event statistic
  • same_location - Same location event statistic
  • sivan - Wason task performance and morality
  • therapeutic - Data come from an experimental study (Rosa, Rosa, Sarner, and Barrett, 1998) that were also used in Howell (2012, p.196). An experiment was conducted to investigate if Therapeutic Touch practitioners who were blindfolded can effectively identify which of their hands is below the experimenter¡¯s. Twenty-eight practitioners were involved and tested 10 times in the experiment. Researchers expected an average of 5 correct answers from each practitioner as it is the number by chance if they do not outperform others.
  • timssICC - Trends in International Mathematics and Science Study (TIMSS) 2011-2015
  • tvprices - Precision of the Anchor Influences the Amount of Adjustment
  • wilson - Facial trustworthiness and criminal sentencing

On CRAN:

Conda:

openblasfortranglibc

7.93 score 15 stars 3 packages 63 scripts 880 downloads 4 exports 109 dependencies

Last updated from:c3c23148dc. Checks:4 NOTE, 10 OK, 1 WARNING. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE299
linux-devel-x86_64NOTE278
source / vignettesOK307
linux-release-arm64OK303
linux-release-x86_64OK314
macos-release-arm64OK278
macos-release-x86_64OK770
macos-oldrel-arm64OK232
macos-oldrel-x86_64OK668
windows-devel-arm64NOTE494
windows-devel-x86_64NOTE334
windows-release-arm64WARNING464
windows-release-x86_64OK268
windows-oldrel-x86_64OK287
wasm-releaseOK166

Exports:bartlett_testBFcor_testmvt_test

Dependencies:abindbackportsbainBergmberryFunctionsBHbootbridgesamplingBrobdingnagcachemcallrcheckmateclicodacpp11DEoptimRdescdistributionalergmevaluatefarverfastmapgenericsggplot2gluegridExtragslgtablehighrinlineisobandknitrlabelingLaplacesDemonlatticelavaanlifecyclelme4logsplineloolpSolveAPImagrittrMASSMatrixmatrixcalcMatrixModelsmatrixStatsmcmcMCMCpackmemoisemetaBMAmgcvminqamnormtmvtnormnetworknlmenloptrnumDerivotelpbivnormpillarpkgbuildpkgconfigposteriorpracmaprocessxpspurrrQRMquadprogquantregQuickJSRR6rbibutilsRColorBrewerRcppRcppEigenRcppParallelRdpackreformulasRglpkrlangrlerobustbaserstanrstantoolsS7sandwichscalesslamSparseMStanHeadersstatnet.commonstringistringrsurvivaltensorAtibbletimeDatetimeSeriestrustutf8vctrsviridisLitewithrxfunyamlzoo

Introduction to BFpack
Introduction | Reference | Usage | Arguments | Output | Example analyses | Normal linear models (t-testing, linear regression, (M)AN(C)OVA) | Univariate t testing | Multivariate t testing | Analysis of variance | Univariate and multivariate multiple regression | Testing independent group variances | Testing correlations | Meta-analyses | Exponential random graph models | Hypothesis testing using normal approximations | Running BF on a named vector | Logistic regression | Poisson regression

Last update: 2026-07-10
Started: 2026-07-10

Directly Comparing Constrained Hypotheses in Regression with BFpack
Introduction and learning objectives | The running example | What you will be able to do | Setup: packages, data, and model | The joint directional test in BFpack | Step 1 — Read the exact parameter names | Step 2 — Formulate the hypotheses | Results | Why not just test each coefficient and contrast separately? | References

Last update: 2026-07-10
Started: 2026-07-10

Jointly testing Directional Expectations on Correlations with BFpack
Introduction and learning objectives | The running example | What you will be able to do | Setup: packages, seed, and data | The joint directional test in BFpack | Step 1 — Estimate the correlations per group | Step 2 — Read the exact parameter names | Step 3 — Formulate the hypotheses | Step 4 — Compute the Bayes factors | Results | Why not just test each correlation separately? | References

Last update: 2026-07-10
Started: 2026-07-10

Testing Scientific Expectations under ERGMs with BFpack
Introduction and learning objectives | Why go beyond the p-value? | What you will be able to do after this session | Setup: packages, seed, and data | The chemnet policy network | Preparing the network data | Build the network objects | A simplified ERGM to learn the workflow | Step 1 — Fit the model | Step 2 — Read the exact parameter names | Step 3 & 4 — Test a precise null: does preference similarity matter? | Testing competing constrained hypotheses | Reading the specification table | Changing the prior probabilities of hypotheses | The full model, reproducing the paper | Published results | Test 1 — no effect of preference similarity | Test 2 — the ranking of opportunity-structure effects | Reporting and interpretation checklist | References

Last update: 2026-07-10
Started: 2026-07-10

Readme and manuals

Help Manual

Help pageTopics
BFpack: Flexible Bayes factor testing of scientific expectationsBFpack-package BFpack
Actors from a small hypothetical networkactors
Multiple Sources of Attentional Dysfunction in Adults With Tourette's Syndromeattention
Bartlett Test of Homogeneity of Variancesbartlett_test bartlett_test.default
Bayes factors for Bayesian exploratory and confirmatory hypothesis testingBF BF.default BF.lm BF.rma.uni BF.t_test
Bayesian correlation analysiscor_test
Student t approximations of Fisher transformed correlationsFcor
fMRI datafmri
Memory data on health and schizophrenic patientsmemory
Multivariate Student t testmvt_test
A sequence of innovation-related e-mail messagesrelevents
Same culture event statisticsame_culture
Same location event statisticsame_location
Wason task performance and moralitysivan
Data come from an experimental study (Rosa, Rosa, Sarner, and Barrett, 1998) that were also used in Howell (2012, p.196). An experiment was conducted to investigate if Therapeutic Touch practitioners who were blindfolded can effectively identify which of their hands is below the experimenter¡¯s. Twenty-eight practitioners were involved and tested 10 times in the experiment. Researchers expected an average of 5 correct answers from each practitioner as it is the number by chance if they do not outperform others.therapeutic
Trends in International Mathematics and Science Study (TIMSS) 2011-2015timssICC
Precision of the Anchor Influences the Amount of Adjustmenttvprices
Facial trustworthiness and criminal sentencingwilson