View source: R/P-value_Functions.R
p2pp | R Documentation |
This function converts p-values into the upper bounds for posterior probability that the alternative hypotheis H1 is true, under the assumption of equal prior probabilities for H0 and H1.
p2pp(p, digits = NULL)
p |
A numeric p-value (or numeric vector of p-values), obtained from running a statistical model or test. All values should be proportions within the closed unit interval (0 <= p <= 1). |
digits |
An integer specifying the number of decimal places to used when rounding the posterior probabilities. Defaults to NULL, which does not round the result. |
=============================================================================
The upper bound for the posterior probability that the alternative hypothesis H1 is true can be obtained from a p-value with a simple formula when the prior probabilities of the null and alternative hypotheses (H0 and H1, respectively) are equal: PrU (H1 | p) = BFB/(1 + BFB). The posterior probability is a measure of the evidence against the null hypothesis. When the p-value is zero or one, the result is returned as NaN (not a number).
A numeric vector of posterior probability values of the same length as p.
Benjamin, D. J., & Berger, J. O. (2019). Three recommendations for improving the use of p-values. The American Statistician, 73 (Supplement 1), 186-191. doi:10.1080/00031305.2018.1543135
Wasserstein, R. L., Schirm, A. L., & Lazar, N. A. (2019). Moving to a world beyond "p < .05". The American Statistician, 73(Supplement 1), 1-19. doi:10.1080/00031305.2019.1583913
p2pp(.05)
p2pp(c(.1, .05, .01, .005, .001, .0001, .00001), digits = 2)
p2pp(0)
p2pp(p = NA) # Missing p returns a missing value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.