library("psych350lab")
format_p_value(0.023)[1] ".023"
format_p_value(0.0004)[1] "< .001"
format_p_value(0.150, include_p = TRUE)[1] "p = .150"
Formats a p-value following APA conventions: values less than .001 are displayed as "< .001", and leading zeros are removed.
format_p_value(p, digits = 3, include_p = FALSE)
p
|
Numeric. The p-value to format. |
digits
|
Integer. Number of decimal places. Default is 3. |
include_p
|
Logical. If TRUE, prefix with "p = " or "p < ". Default FALSE. |
A character string with the formatted p-value.
library("psych350lab")
format_p_value(0.023)[1] ".023"
format_p_value(0.0004)[1] "< .001"
format_p_value(0.150, include_p = TRUE)[1] "p = .150"