Learn R Programming

tidyBF (version 0.4.0)

bf_extractor: Extract Bayes Factors from BayesFactor model object.

Description

Extract Bayes Factors from BayesFactor model object.

Usage

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, see bayestestR::hdi()), "eti" (see bayestestR::eti()) or "si" (see bayestestR::si()).

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 as top.text (will be displayed on top of the Bayes Factor top.text/message).

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().

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab