signif_sym: Changes p-value number to a significance symbol for...

View source: R/formatting.R

signif_symR Documentation

Changes p-value number to a significance symbol for decorative purposes

Description

Any NAs in the input are always transformed to "". Probabilities outside range <0,1> raise an error.

Usage

signif_sym(x, max_asterisks = 5, bonferoni = 1, include_dot = T, ns_sym = " ")

Arguments

x

A numeric vector of input probabilities

max_asterisks

Number of asterisks (*) for the most significant results, default is 5. Cannot be smaller than 2. Set to 3 for APA/NEJM standards.

bonferoni

Number of tests in a family of tests when applying the Bonferroni correction for multiple comparisons problem. Is 1 by default which is same as not applying any correction. Use it only if the passed p-values are not corrected already.

include_dot

Logical, default TRUE, should the dot symbol be used for borderline significance that is between 5% and 10%?

ns_sym

Character (default ' '), the symbol used for the non-significant results. Set to 'ns' APA/NEJM standards.

Value

A character vector with significance symbols.

See Also

Other publishing-formatting: formatOR(), formatP()

Examples

x <- 3e-4
signif_sym(x)

JantekM/JantoTools documentation built on Jan. 31, 2023, 1:28 p.m.