| test_tmulti | R Documentation |
Performs multiple pairwise comparisons using Student's t-test or the Mann-Whitney U test, with automatic diagnostic checks, effect size estimation, confidence intervals, multiple testing correction, and visualization.
test_tmulti(
...,
comparisons = NULL,
title = "Multiple comparisons (t / MW)",
xlab = "",
ylab = "Value",
style = c("boxplot", "violin", "mono", "halfeye"),
p_adjust = c("none", "holm", "BH", "bonferroni"),
colors = NULL,
help = FALSE,
verbose = TRUE
)
... |
Numeric vectors or a data frame containing groups in columns. |
comparisons |
Optional list of character vectors specifying pairwise
comparisons between groups. Each element should contain two group names,
such as |
title |
Plot title. |
xlab |
Character string specifying the x-axis label. |
ylab |
Character string specifying the y-axis label. |
style |
Character string specifying the plot style generated by the
function. One of |
p_adjust |
Character string specifying the method used for multiple
testing correction. Supported methods include |
colors |
Optional character vector specifying the box colors. |
help |
Logical. If |
verbose |
Logical. If |
Normality is assessed using the Shapiro-Wilk test, and homogeneity of variances is assessed using Levene's test. When the assumptions are met, a pooled-variance Student's t-test is used. Otherwise, the Mann-Whitney U test is applied with bootstrap confidence intervals.
Effect sizes are calculated as follows:
Cohen's d for t-tests.
Rank-biserial correlation for Mann-Whitney U tests.
A list containing the following components:
resultsA tibble containing the pairwise test results.
plotA plot object generated using ggplot2.
data_longLong-format data used for plotting.
set.seed(123)
df <- data.frame(
control = rnorm(30, mean = 10),
treatment = rnorm(30, mean = 12),
test1 = rnorm(30, mean = 11),
test2 = rnorm(30, mean = 15)
)
test_tmulti(
df,
comparisons = list(
c("control", "treatment"),
c("treatment", "test1")
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.