format_stats.BFBayesFactor {cocoon} | R Documentation |
Format Bayes factors
Description
This method formats Bayes factors from the {BayesFactor} package. By default, this function rounds Bayes factors greater than 1 to one decimal place and Bayes factors less than 1 to two decimal places. Values greater than 1000 or less than 1/1000 are formatted using scientific notation. Cutoffs can be set that format the values as greater than or less than the cutoffs (e.g., BF > 1000 or BF < 0.001). Numbers of digits, cutoffs, italics, and label subscripts are all customizable.
Usage
## S3 method for class 'BFBayesFactor'
format_stats(
x,
digits1 = 1,
digits2 = 2,
cutoff = NULL,
label = "BF",
italics = TRUE,
subscript = "10",
type = "md",
...
)
Arguments
x |
BayesFactor object or vector of numeric Bayes factor values |
digits1 |
Number of digits after the decimal for Bayes factors > 1 |
digits2 |
Number of digits after the decimal for Bayes factors < 1 |
cutoff |
Cutoff for using |
label |
Character string for label before Bayes factor. Default is BF.
Set |
italics |
Logical value (default = TRUE) for whether label should be italicized (BF or BF) |
subscript |
Subscript to include with BF label ( |
type |
Type of formatting ( |
... |
Additional arguments passed to methods. |
Value
A character string of statistical information formatted in Markdown or LaTeX.
See Also
Other functions for printing statistical objects:
format_bf()
,
format_corr()
,
format_stats()
,
format_stats.easycorrelation()
,
format_stats.htest()
,
format_ttest()
Examples
# Prepare statistical object
test_bf <- BayesFactor::ttestBF(mtcars$vs, mtcars$am)
# Format Bayes factor
format_stats(test_bf)
# Control cutoff for output
format_stats(test_bf, cutoff = 3)
# Change digits, remove italics and subscript
format_stats(test_bf, digits2 = 1, italics = FALSE, subscript = "")
# Return only Bayes factor value (no label)
format_stats(test_bf, label = "")
# Format for LaTeX
format_stats(test_bf, type = "latex")