Description Usage Arguments Details Value References See Also Examples
Calibrate p-values under a robust perspective so that they can be interpreted as either lower bounds on the posterior probabilities of point null hypotheses or as lower bounds on the probabilities of type I errors.
1 | pcal(p, prior_prob = 0.5)
|
p |
A numeric vector with values in the [0,1] interval. |
prior_prob |
A numeric vector with values in the [0,1] interval. If |
sellke2001;textualpcal developed a calibration of p-values into lower bounds for the posterior probabilities of point null hypotheses or lower bounds for the probabilities of type I errors for the case when both the null and the alternative hypotheses have 0.5 prior probability. pcal generalizes the aforementioned calibration for prior probabilities other than 0.5.
pcal starts by transforming the values in p into lower bounds on Bayes factors using bcal and then uses bfactor_to_prob together with prior probabilities prior_prob to turn those Bayes factors into posterior probabilities. For each element of p, pcal returns an approximation of the smallest posterior probability of the null hypothesis that is found by changing the prior distribution of the parameter of interest (under the alternative hypothesis) over wide classes of distributions.
The prior_prob argument is optional and is set to 0.5 by default, implying prior equiprobability of hypotheses. prior_prob can only be of length equal to the length of p, in which case each prior probability in prior_prob is used in the calibration of the corresponding element of p, or of length 1, in which case it will be recycled (if length(p) > 1) and the same prior_prob value is used in the calibration of all the elements of p.
The output of pcal can also be interpreted as lower bounds on the probabilities of type I errors. Note that the output of this calibration has both Bayesian and Frequentist interpretations. \insertCitesellke2001;textualpcal noted that a scenario in which they definitely recommend this calibration is when investigating fit to the null model 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.
If length(p) > 1 then pcal returns a numeric vector with the same length as p, otherwise it returns a numeric vector with the same length as prior_prob.
bcal for a p-value calibration that returns lower bounds on Bayes factors in favor of point null hypotheses.
1 2 3 4 5 6 7 8 9 10 | # Calibration of a typical "threshold" p-value:
pcal(.05)
# Calibration of typical "threshold" p-values:
pcal(c(.1, .05, .01, .005, .001))
# Application: chi-squared goodness-of-fit test,
# lower bound on the posterior probability of the null hypothesis:
x <- matrix(c(12, 41, 25, 33), ncol = 2)
pcal(chisq.test(x)[["p.value"]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.