Creating a new column with significance labels
signif_column.Rd
Arguments
- data
Data frame from which variables specified are preferentially to be taken.
- p
The column containing p-values.
- ...
Currently ignored.
Value
Returns the dataframe in tibble format with an additional column corresponding to APA-format statistical significance labels.
Examples
# preparing a new dataframe
df <- cbind.data.frame(
x = 1:5,
y = 1,
p.value = c(0.1, 0.5, 0.00001, 0.05, 0.01)
)
# dataframe with significance column
signif_column(data = df, p = p.value)
#> # A tibble: 5 × 4
#> x y p.value significance
#> <int> <dbl> <dbl> <chr>
#> 1 1 1 0.1 ns
#> 2 2 1 0.5 ns
#> 3 3 1 0.00001 ***
#> 4 4 1 0.05 ns
#> 5 5 1 0.01 *