formatBF {BayesRep} | R Documentation |
Formatting of Bayes factors
Description
Formats Bayes factors such that Bayes factors smaller than 1 are
represented as ratios , where
is rounded to the
specified number of digits, while Bayes factors larger than 1 are only
rounded to the specified number of digits.
Usage
formatBF(BF, digits = "default")
Arguments
BF |
Bayes factor |
digits |
either |
Details
The default formatting, which is recommended in Held and Ott (2018),
is as follows: For very small Bayes factors BF < 1/1000, "< 1/1000" is
returned. Bayes factors BF with 1/1000 BF
1/10 are formatted as
where
is an integer and Bayes
factors BF with
BF
1 as
, where
is rounded to one decimal place. Accordingly, Bayes factors
BF
10 are rounded to one decimal place, Bayes
factors 10
BF
1000 are rounded to the next
integer and for larger Bayes factors, "> 1000" is returned.
If digits is specified, the Bayes factor (if it is 1) or its
inverse (if the Bayes factor is
1) is rounded to the number of
decimal places specified and returned as a ratio if the Bayes factor is
1.
Value
A character vector of ratios (for inputs ) or rounded
numeric values (for inputs
) ).
Author(s)
Manuela Ott (creator of package pCalibrate
), Leonhard Held
(contributor of package pCalibrate
), Samuel Pawel (made small
changes to pCalibrate::formatBF
)
References
Held, L. and Ott, M. (2018). On -values and Bayes factors.
Annual Review of Statistics and Its Application, 5, 393-419.
doi:10.1146/annurev-statistics-031017-100307
Examples
(bf <- BFr(to = 2, so = 0.5, tr = 2.5, sr = 0.9))
formatBF(BF = bf)