f_pval: Format P-Values

Description Usage Arguments Value See Also Examples

View source: R/f_pval.R

Description

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

Usage

1
2
3
4
5
6
7
8
f_pval(
  x,
  alpha = getOption("numformalpha"),
  digits = getOption("numformdigits"),
  ...
)

ff_pval(...)

Arguments

x

A p-value.

alpha

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

digits

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

...

Other values passed to f_num.

Value

Returns a string of publication ready p-values.

See Also

f_num

Examples

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

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

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

numform documentation built on Oct. 10, 2021, 1:10 a.m.