| test.kruskal | R Documentation |
Performs the Kruskal-Wallis rank-sum test for comparing three or more independent groups, followed by Dunn's post-hoc test with multiple comparison adjustment.
test.kruskal(
...,
title = "Kruskal-Wallis + Dunn",
xlab = "Group",
ylab = "Value",
style = c("boxplot", "violin", "mono", "halfeye"),
adjust = c("bonferroni", "holm", "BH"),
help = FALSE,
verbose = TRUE
)
... |
Numeric vectors representing groups, or a data frame with two or more columns (each column is treated as a group). |
title |
Character. Plot title. |
xlab |
Character. X-axis label. |
ylab |
Character. Y-axis label. |
style |
Character. Plot style. One of:
|
adjust |
Character. Method for p-value adjustment in Dunn's test.
One of |
help |
Logical. If |
verbose |
Logical. If |
This function is a non-parametric alternative to one-way ANOVA and is recommended when normality or homoscedasticity assumptions are violated.
Invisibly returns a list with the following components:
Test type.
Kruskal-Wallis H statistic.
Degrees of freedom.
Global test p-value.
Epsilon-squared effect size.
Bootstrap confidence interval for effect size.
Group means and standard deviations.
Dunn post-hoc results.
Significant pairwise comparisons.
Long-format data used in the analysis.
set.seed(123)
n <- 25
df <- data.frame(
control = rexp(n, rate = 1),
treatment1 = rexp(n, rate = 0.6),
treatment2 = rgamma(n, shape = 2, scale = 1)
)
test.kruskal(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.