ggstatsplot (version 0.0.8)

bf_extractor: Convenience function to extract bayes factors and details about posterior (mean, median, HDI, etc.) from BayesFactor model object.

Description

Convenience function to extract bayes factors and details about posterior (mean, median, HDI, etc.) from BayesFactor model object.

Usage

bf_extractor(bf.object, posterior = FALSE, iterations = 1000,
  cred.int = 0.95)

Arguments

bf.object

An object from BayesFactor package test results.

posterior

If TRUE, the dataframe will contain mean, median, standard deviation, and standard error for the posterior.

iterations

The number of iterations to sample for computing posterior (default: 1000).

cred.int

A scalar between 0 and 1, indicating the mass within the credible interval that is to be estimated (default: 0.95).

Examples

Run this code
# NOT RUN {
# getting only bayes factors
ggstatsplot::bf_extractor(BayesFactor::anovaBF(Sepal.Length ~ Species,
  data = iris,
  progress = FALSE
))
# }
# NOT RUN {
# show all columns in a tibble
options(tibble.width = Inf)

# getting bayes factors and posteriors
ggstatsplot::bf_extractor(
  BayesFactor::correlationBF(
    x = iris$Sepal.Length,
    y = iris$Sepal.Width
  ),
  posterior = TRUE,
  iterations = 1000,
  cred.int = 0.95
)
# }

Run the code above in your browser using DataCamp Workspace