p: Format P-Values

Description Usage Arguments Value See Also Examples

Description

Format p-values for reporting using a < or = sign if greater than alpha level.

Usage

1
p(x, alpha = getOption("digit_alpha"), digits = getOption("digit_digits"))

Arguments

x

A p-value.

alpha

The alpha cut off to use. Defaults to .05. Can be set globally via: options(digit_alpha = n) where n is the alpha level.

digits

The number of digits to use. Defaults to 3. Can be set globally via: options(digit_digits = n) where n is the number of digits beyond the decimal point to include.

Value

Returns a string of publication ready p-values.

See Also

f

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
p(.05)
p(.04999999999999999)
p(.0002)
p(.0002, .001)

mod1 <- t.test(1:10, y = c(7:20))
p(mod1$p.value)

mod2 <- t.test(1:10, y = c(7:20, 200))
p(mod2$p.value)

trinker/digit documentation built on May 31, 2019, 8:41 p.m.