bf_extractor: Extract Bayes Factors from 'BayesFactor' model object.

Description Usage Arguments Note Examples

View source: R/helpers_bf_tests.R

Description

Extract Bayes Factors from BayesFactor model object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
bf_extractor(
  bf.object,
  conf.method = "hdi",
  centrality = "median",
  conf.level = 0.95,
  k = 2L,
  top.text = NULL,
  output = "dataframe",
  ...
)

Arguments

bf.object

An object from BayesFactor package.

conf.method

The type of index used for Credible Interval. Can be "hdi" (default), "eti", or "si" (see si(), hdi(), eti() functions from bayestestR package).

centrality

The point-estimates (centrality indices) to compute. Character (vector) or list with one or more of these options: "median", "mean", "MAP" or "all".

conf.level

Confidence/Credible Interval (CI) level. Default to 0.95 (95%).

k

Number of digits after decimal point (should be an integer) (Default: k = 2L).

top.text

Text to display on top of the Bayes Factor message. This is mostly relevant in the context of ggstatsplot functions.

output

If "expression", will return expression with statistical details, while "dataframe" will return a dataframe containing the results.

...

Additional arguments passed to parameters::model_parameters.BFBayesFactor().

Note

Important: don't enter 1/bf.object to extract results for null hypothesis; doing so will return wrong results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# setup
library(tidyBF)
set.seed(123)

# creating a `BayesFactor` object
bf_obj <-
  BayesFactor::anovaBF(
    formula = Sepal.Length ~ Species,
    data = iris,
    progress = FALSE
  )

# extracting Bayes Factors in a dataframe
bf_extractor(bf_obj)

tidyBF documentation built on June 12, 2021, 9:06 a.m.