Learn R Programming

metap (version 0.7)

two2one: Convert two-sided p-values to one-sided

Description

Convert two-sided $p$-values to one-sided

Usage

two2one(p, two = NULL, invert = NULL)

Arguments

p
A vector of p-values
two
A logical vector defining which $p$-values are two-sided and to be converted
invert
A logical vector defining which $p$-values are to be inverted

Value

Details

The $p$-values supplied to the other functions should be one-sided and all in te same direction. This convenience function will convert two-sided to one-sided and invert as necessary. By default it is assumed that all $p$-values are two-sided and the function converts them all to one-sided. Use invert to specify if some of the tests resulted in outcomes in the other direction. So for example a value of 0.05 wil be converted to 0.025 unless invert is TRUE in which case it is converted to 0.975.

Examples

Run this code
data(rosenthal)
twop <- with(rosenthal, (pt(t, df)))

Run the code above in your browser using DataLab