convertp: Convert p-values into s-values, Bayes Factor Bounds, and...

View source: R/P-value_Functions.R

convertpR Documentation

Convert p-values into s-values, Bayes Factor Bounds, and posterior probabilities that H1 is true

Description

This function converts p-values into three different measures: s-values, Bayes Factor Bounds (BFBs), and posterior probabilities that the alternative hypotheis H1 is true.

Usage

convertp(p, digits = NULL)

Arguments

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 results. Defaults to NULL, which does not round the results.

Details

=============================================================================

This function applies p2s, p2bfb, and p2pp to the p-values supplied. It is a convenient way to get all three results with a single function call.

Value

A data frame containing three numeric columns values, each the same length as p: s-value, BFB, and posterior probability.

References

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

Greenland, S. (2019). Valid p-values behave exactly as they should: Some misleading criticisms of p-values and their resolution with s-values. The American Statistician, 73(Supplement 1), 106-114. doi:10.1080/00031305.2018.1529625

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

See Also

p2s for s-values, p2bfb for BFBs, and p2pp for posterior probabilities.

Examples

convertp(.05)
convertp(c(.1, .05, .01, .005, .001, .0001, .00001), digits = 2)
convertp(p = NA) # Missing p returns a missing value.


sjpierce/piercer documentation built on Dec. 30, 2024, 3:28 p.m.