Skip to contents

p-value in APA format

Usage

apa_p(p, inline = TRUE, plain = FALSE)

Arguments

p

probability

inline

If TRUE (default), returns statistic (e.g.,e p = .04), otherwise just the number (e.g., .04)

plain

Outputs plain text compatible with latex if TRUE, otherwise defaults to markdown

Value

character vector

Examples

# Values less than .001 are <.001
apa_p(.0002)
#> [1] "*p*&nbsp;<&nbsp;.001"
# Values between .001 and .01 are rounded to 3 digits
apa_p(.002)
#> [1] "*p*&nbsp;=&nbsp;.002"
# Values between .01 and .995 are rounded to 2 digits
apa_p(.02)#'
#> [1] "*p*&nbsp;=&nbsp;.02"
apa_p(.22)
#> [1] "*p*&nbsp;=&nbsp;.22"
apa_p(.994)
#> [1] "*p*&nbsp;=&nbsp;.99"
# Values above .995 are >.99
apa_p(.999)
#> [1] "*p*&nbsp;=&nbsp;1.00"