Create significant symbols for p-values

p_range(p)

Arguments

p

A numeric p value (usually yielded from a statistical test).

Value

A character significant symbol. * represents the p is within the range of (0.05, 0.01], ** for (0.01, 0.001], and *** for (0.001, +inf]

Examples

p_range(0.02)
#> [1] "*"
#> #> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’: #> #> filter, lag
#> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union
t_test_one_sample(color_index, "color_index", mu = 0) %>% mutate(sig = p_range(p))
#> Warning: The `t_test_one_sample()` function expects a grouped data frame (i.e., from `dplyr::group_by()`). Returning statistics for the overall column.
#> Warning: `...` must not be empty for ungrouped data frames. #> Did you want `data = everything()`?
#> # A tibble: 1 x 5 #> tvalue df p p_bonferroni sig #> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 4.44 231 0.0000142 0.0000142 ***