Last chance! 50% off unlimited learning
Sale ends in
Format p-values.
format_p(p, stars = FALSE, stars_only = FALSE, name = "p",
missing = "", digits = 3, ...)
value or vector of p-values.
Add significance stars (e.g., p < .001***).
Return only significance stars.
Name prefixing the text. Can be NULL
.
Value by which NA
values are replaced. By default, an empty string (i.e. ""
) is returned for NA
.
Number of significant digits. May also be "scientific"
to return exact p-values in scientific notation, or "apa"
to use an APA-style for p-values.
Arguments from other methods.
A formatted string.
# NOT RUN {
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)
format_p(p_value(model)$p, digits = "scientific")
# }
Run the code above in your browser using DataLab