add_p.RdCalculates and appends p-values with optional statistical details to a summary table based on variable types and group comparisons. Handles both continuous and categorical variables with appropriate statistical tests.
add_p(
summary,
digit = 3,
asterisk = FALSE,
add_method = FALSE,
add_statistic_name = FALSE,
add_statistic_value = FALSE
)A data frame that has been processed by add_summary().
A numeric determine decimal. Accepts:
3:convert to 3 decimal, default
4:convert to 4 decimal
Logical indicating whether to show asterisk significance markers.
Control parameter for display of statistical methods. Accepts:
'code': Show method as codes according to order of appearance
TRUE/'true': Show method text
FALSE/'false': Not show method text
Logical indicating whether to include test statistic names.
Logical indicating whether to include test statistic values.
A data frame merged with statistical test results, containing: - Variable names - Summary - Formatted p-values - Optional method names/codes - Optional statistic names/values
# `summary` is a data frame processed by `add_var()` and `add_summary()`:
data <- add_var(iris, var = c("Sepal.Length", "Sepal.Width"), group = "Species")
summary <- add_summary(data)
#> ⠙ Summarizing
#> ✔ Summarizing [43ms]
#>
# Add statistical test results
result <- add_p(summary)
#> ⠙ Geting p-values
#> ✔ Geting p-values [10ms]
#>