Skip to contents

Create reports of Bayes factors for model comparison.

Usage

# S3 method for bayesfactor_models
report(
  x,
  interpretation = "jeffreys1961",
  exact = TRUE,
  protect_ratio = TRUE,
  ...
)

# S3 method for bayesfactor_inclusion
report(
  x,
  interpretation = "jeffreys1961",
  exact = TRUE,
  protect_ratio = TRUE,
  ...
)

Arguments

x

Object of class bayesfactor_inclusion.

interpretation

Effect size interpretation set of rules (see interpret_bf).

exact

Should very large or very small values be reported with a scientific format (e.g., 4.24e5), or as truncated values (as "> 1000" and "< 1/1000").

protect_ratio

Should values smaller than 1 be represented as ratios?

...

Arguments passed to or from other methods.

Value

An object of class report().

Examples

library(report)

mo0 <- lm(Sepal.Length ~ 1, data = iris)
mo1 <- lm(Sepal.Length ~ Species, data = iris)
mo2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris)
mo3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris)

if (require("bayestestR")) {
  # Bayes factor - models
  BFmodels <- bayesfactor_models(mo1, mo2, mo3, denominator = mo0)

  r <- report(BFmodels)
  r
  as.data.frame(r)

  # Bayes factor - inclusion
  inc_bf <- bayesfactor_inclusion(BFmodels, prior_odds = c(1, 2, 3), match_models = TRUE)

  r <- report(inc_bf)
  r
  as.data.frame(r)
}
#> Loading required package: bayestestR
#> Terms                | Pr(prior) | Pr(posterior) | Inclusion BF
#> ---------------------------------------------------------------
#> Species              |      0.43 |          0.95 |       128.00
#> Petal.Length         |      0.29 |          0.95 |        61.80
#> Petal.Length:Species |      0.43 |          0.05 |  1/-3.05e-01
#> 
#> Across matched models only.
#> With custom prior odds of [1, 2, 3].