p_to_bf: Convert _p_ values to approximate (pseudo) Bayes Factors...

View source: R/DPI.R

p_to_bfR Documentation

Convert p values to approximate (pseudo) Bayes Factors (PseudoBF10).

Description

Convert p values to approximate (pseudo) Bayes Factors (PseudoBF10). This transformation has been suggested by Wagenmakers (2022).

Usage

p_to_bf(p, n, log = FALSE, label = FALSE)

Arguments

p

p value(s).

n

Number of observations.

log

Return log(BF10) or raw BF10. Defaults to FALSE.

label

Add labels (i.e., names) to returned values. Defaults to FALSE.

Value

A (named) numeric vector of pseudo Bayes Factors (\text{PseudoBF}_{10}).

References

Wagenmakers, E.-J. (2022). Approximate objective Bayes factors from p-values and sample size: The 3p\sqrt{n} rule. PsyArXiv. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.31234/osf.io/egydq")}

See Also

bayestestR::p_to_bf()

Examples

p_to_bf(0.05, 100)
p_to_bf(c(0.01, 0.05), 100)
p_to_bf(c(0.001, 0.01, 0.05, 0.1), 100, label=TRUE)
p_to_bf(c(0.001, 0.01, 0.05, 0.1), 1000, label=TRUE)


DPI documentation built on Nov. 24, 2025, 5:07 p.m.