p_calibrate | R Documentation |
Compute calibrated p-values that can be interpreted probabilistically, i.e. as posterior probability of H0 (given that H0 and H1 have equal prior probabilities).
p_calibrate(x, ...)
## Default S3 method:
p_calibrate(x, type = "frequentist", verbose = TRUE, ...)
x |
A numeric vector of p-values, or a regression model object. |
... |
Currently not used. |
type |
Type of calibration. Can be |
verbose |
Toggle warnings. |
The Bayesian calibration, i.e. when type = "bayesian"
, can be interpreted
as the lower bound of the Bayes factor for H0 to H1, based on the data.
The full Bayes factor would then require multiplying by the prior odds of
H0 to H1. The frequentist calibration also has a Bayesian interpretation; it
is the posterior probability of H0, assuming that H0 and H1 have equal
prior probabilities of 0.5 each (Sellke et al. 2001).
The calibration only works for p-values lower than or equal to 1/e
.
A data frame with p-values and calibrated p-values.
Thomas Sellke, M. J Bayarri and James O Berger (2001) Calibration of p Values for Testing Precise Null Hypotheses, The American Statistician, 55:1, 62-71, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/000313001300339950")}
model <- lm(mpg ~ wt + as.factor(gear) + am, data = mtcars)
p_calibrate(model, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.