Learn R Programming

statsExpressions (version 0.7.0)

bf_extractor: Extract Bayes Factors from BayesFactor model object.

Description

Extract Bayes Factors from BayesFactor model object.

Usage

bf_extractor(
  bf.object,
  conf.level = 0.95,
  centrality = "median",
  conf.method = "hdi",
  k = 2L,
  top.text = NULL,
  output = "dataframe",
  ...
)

Arguments

bf.object

An object from BayesFactor package.

conf.level

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

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.method

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

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

Examples

Run this code
# NOT RUN {
# setup
library(statsExpressions)
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