https://github.com/cran/bayestestR
Raw File
Tip revision: d8462ad2168ad7ee61c0d7e679174e775f01a9be authored by Dominique Makowski on 18 January 2020, 07:10 UTC
version 0.5.0
Tip revision: d8462ad
print.bayesfactor_inclusion.R
#' @export
print.bayesfactor_inclusion <- function(x, digits = 2, log = FALSE, ...) {
  BFE <- x
  priorOdds <- attr(BFE, "priorOdds")

  if (log) {
    BFE$BF <- log(BFE$BF)
  }

  BFE$BF <- .format_big_small(BFE$BF, digits = digits)

  colnames(BFE) <- c("Pr(prior)", "Pr(posterior)", "Inclusion BF")

  insight::print_color("# Inclusion Bayes Factors (Model Averaged)\n\n", "blue")
  print.data.frame(BFE, digits = digits)

  cat("\n")
  cat("* Compared among: ")
  if (attr(BFE, "matched")) {
    insight::print_color("matched models only\n", "cyan")
  } else {
    insight::print_color("all models\n", "cyan")
  }

  cat("*    Priors odds: ")
  if (!is.null(priorOdds)) {
    insight::print_color("custom\n", "cyan")
  } else {
    insight::print_color("uniform-equal\n", "cyan")
  }

  if (log) insight::print_color("\nBayes Factors are on the log-scale.\n", "red")
  invisible(x)
}
back to top