format_p | R Documentation |
Format p-values.
format_p(
p,
stars = FALSE,
stars_only = FALSE,
whitespace = TRUE,
name = "p",
missing = "",
decimal_separator = NULL,
digits = 3,
...
)
p |
value or vector of p-values. |
stars |
Add significance stars (e.g., p < .001***). For Bayes factors, the thresholds for "significant" results are values larger than 3, 10, and 30. |
stars_only |
Return only significance stars. |
whitespace |
Logical, if |
name |
Name prefixing the text. Can be |
missing |
Value by which |
decimal_separator |
Character, if not |
digits |
Number of significant digits. May also be |
... |
Arguments from other methods. |
A formatted string.
format_p(c(.02, .065, 0, .23))
format_p(c(.02, .065, 0, .23), name = NULL)
format_p(c(.02, .065, 0, .23), stars_only = TRUE)
model <- lm(mpg ~ wt + cyl, data = mtcars)
p <- coef(summary(model))[, 4]
format_p(p, digits = "apa")
format_p(p, digits = "scientific")
format_p(p, digits = "scientific2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.