pcal: Lower Bounds on the Posterior Probabilities of Point Null...

Description Usage Arguments Details Value References See Also Examples

View source: R/pcal.R

Description

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.

Usage

1
pcal(p, prior_prob = 0.5)

Arguments

p

A numeric vector with values in the [0,1] interval.

prior_prob

A numeric vector with values in the [0,1] interval. If length(p) == 1 then prior_prob can be of any positive length, but if length(p) > 1 then the length of prior_prob can only be 1 or equal to the length of p.

Details

\insertCite

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.

Value

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.

References

\insertAllCited

See Also

Examples

 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"]])

pcal documentation built on July 8, 2020, 6:22 p.m.

Related to pcal in pcal...