View source: R/t_test_pairwise.R
t_test_pairwise | R Documentation |
Conducts a t-test for every possible pairwise comparison with Holm or Bonferroni correction
t_test_pairwise(
data = NULL,
iv_name = NULL,
dv_name = NULL,
sigfigs = 3,
welch = TRUE,
cohen_d = TRUE,
cohen_d_w_ci = TRUE,
adjust_p = "holm",
bonferroni = NULL,
mann_whitney = TRUE,
mann_whitney_exact = FALSE,
t_test_stats = TRUE,
sd = FALSE,
round_p = 3,
anova = FALSE,
round_f = 2,
round_t = 2,
round_t_test_df = 2
)
data |
a data object (a data frame or a data.table) |
iv_name |
name of the independent variable |
dv_name |
name of the dependent variable |
sigfigs |
number of significant digits to round to |
welch |
Should Welch's t-tests be conducted?
By default, |
cohen_d |
if |
cohen_d_w_ci |
if |
adjust_p |
the name of the method to use to adjust p-values.
If |
bonferroni |
The use of this argument is deprecated.
Use the 'adjust_p' argument instead.
If |
mann_whitney |
if |
mann_whitney_exact |
this is the input for the 'exact'
argument used in the 'stats::wilcox.test' function, which
conducts a Mann-Whitney test. By default, |
t_test_stats |
if |
sd |
if |
round_p |
number of decimal places to which to round p-values (default = 3) |
anova |
Should a one-way ANOVA be conducted and reported?
By default, |
round_f |
number of decimal places to which to round the f statistic (default = 2) |
round_t |
number of decimal places to which to round the t statistic (default = 2) |
round_t_test_df |
number of decimal places to which to round the degrees of freedom for t tests (default = 2) |
the output will be a data.table showing results of all pairwise comparisons between levels of the independent variable.
## Not run:
# Basic example
t_test_pairwise(
data = iris, iv_name = "Species", dv_name = "Sepal.Length")
# Welch's t-test
t_test_pairwise(
data = mtcars, iv_name = "am", dv_name = "hp")
# A Student's t-test
t_test_pairwise(
data = mtcars, iv_name = "am", dv_name = "hp", welch = FALSE)
# Other examples
t_test_pairwise(data = iris, iv_name = "Species",
dv_name = "Sepal.Length", t_test_stats = TRUE, sd = TRUE)
t_test_pairwise(
data = iris, iv_name = "Species", dv_name = "Sepal.Length",
mann_whitney = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.