Compute a Bayesian equivalent of the p-value, related to the odds that a parameter (described by its posterior distribution) has against the null hypothesis (h0) using Mills' (2014, 2017) Objective Bayesian Hypothesis Testing framework. It corresponds to the density value at the null (e.g., 0) divided by the density at the Maximum A Posteriori (MAP).
p_map(x, ...)p_pointnull(x, ...)
# S3 method for numeric
p_map(x, null = 0, precision = 2^10, method = "kernel", ...)
# S3 method for get_predicted
p_map(
x,
null = 0,
precision = 2^10,
method = "kernel",
use_iterations = FALSE,
verbose = TRUE,
...
)
# S3 method for data.frame
p_map(x, null = 0, precision = 2^10, method = "kernel", rvar_col = NULL, ...)
# S3 method for stanreg
p_map(
x,
null = 0,
precision = 2^10,
method = "kernel",
effects = c("fixed", "random", "all"),
component = c("location", "all", "conditional", "smooth_terms", "sigma",
"distributional", "auxiliary"),
parameters = NULL,
...
)
# S3 method for brmsfit
p_map(
x,
null = 0,
precision = 2^10,
method = "kernel",
effects = c("fixed", "random", "all"),
component = c("conditional", "zi", "zero_inflated", "all"),
parameters = NULL,
...
)
Vector representing a posterior distribution, or a data frame of such
vectors. Can also be a Bayesian model. bayestestR supports a wide range
of models (see, for example, methods("hdi")
) and not all of those are
documented in the 'Usage' section, because methods for other classes mostly
resemble the arguments of the .numeric
or .data.frame
methods.
Currently not used.
The value considered as a "null" effect. Traditionally 0, but could also be 1 in the case of ratios of change (OR, IRR, ...).
Number of points of density data. See the n
parameter in density
.
Density estimation method. Can be "kernel"
(default), "logspline"
or "KernSmooth"
.
Logical, if TRUE
and x
is a get_predicted
object,
(returned by insight::get_predicted()
), the function is applied to the
iterations instead of the predictions. This only applies to models that return
iterations for predicted values (e.g., brmsfit
models).
Toggle off warnings.
A single character - the name of an rvar
column in the data
frame to be processed. See example in p_direction()
.
Should results for fixed effects, random effects or both be returned? Only applies to mixed models. May be abbreviated.
Should results for all parameters, parameters for the conditional model or the zero-inflated part of the model be returned? May be abbreviated. Only applies to brms-models.
Regular expression pattern that describes the parameters
that should be returned. Meta-parameters (like lp__
or prior_
) are
filtered by default, so only parameters that typically appear in the
summary()
are returned. Use parameters
to select specific parameters
for the output.
Note that this method is sensitive to the density estimation method
(see the section in the examples below).
Strengths: Straightforward computation. Objective property of the posterior distribution.
Limitations: Limited information favoring the null hypothesis. Relates on density approximation. Indirect relationship between mathematical definition and interpretation. Only suitable for weak / very diffused priors.
Makowski D, Ben-Shachar MS, Chen SHA, Lüdecke D (2019) Indices of Effect Existence and Significance in the Bayesian Framework. Frontiers in Psychology 2019;10:2767. tools:::Rd_expr_doi("10.3389/fpsyg.2019.02767")
Mills, J. A. (2018). Objective Bayesian Precise Hypothesis Testing. University of Cincinnati.