Description Usage Arguments Details Value References See Also Examples
Calibrate p-values under a robust Bayesian perspective so that they can be interpreted as lower bounds on Bayes factors in favor of point null hypotheses.
1 | bcal(p)
|
p |
A numeric vector with values in the [0,1] interval. |
bcal
uses the calibration of p-values into lower bounds for Bayes factors developed in \insertCitesellke2001;textualpcal:
B(p) = -e p log (p)
for p
< (1/e) and
B(p) = 1
otherwise, where p
is a p-value on a classical test statistic and B(p) approximates the smallest Bayes factor that is found by changing the prior distribution of the parameter of interest (under the alternative hypothesis) over wide classes of distributions.
sellke2001;textualpcal noted that a scenario in which they definitely recommend this calibration is when investigating fit to the null model/hypothesis with no explicit alternative in mind. \insertCitepericchiTorres2011;textualpcal warn that despite the usefulness and appropriateness of this p-value calibration it does not depend on sample size and hence the lower bounds obtained with large samples may be conservative.
bcal
returns a numeric vector with the same length
as p
.
pcal
for a p-value calibration that returns lower bounds on the posterior probabilities of point null hypotheses.
bfactor_interpret
and bfactor_interpret_kr
for the interpretation of Bayes factors.
bfactor_log_interpret
and bfactor_log_interpret_kr
for the interpretation of the logarithms of Bayes factors.
bfactor_to_prob
to turn Bayes factors into posterior probabilities.
1 2 3 4 5 6 7 8 9 10 | # Calibration of a typical "threshold" p-value:
bcal(.05)
# Calibration of typical "threshold" p-values:
bcal(c(.1, .05, .01, .005, .001))
# Application: chi-squared goodness-of-fit test,
# lower bound on the Bayes factor in favor of the null hypothesis:
x <- matrix(c(12, 41, 25, 33), ncol = 2)
bcal(chisq.test(x)[["p.value"]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.