One-Way ANOVA (Non-parametric)

The Kruskal-Wallis test is used to explore the relationship between a continuous dependent variable, and a categorical explanatory variable. It is analagous to ANOVA, but with the advantage of being non-parametric and having fewer assumptions. However, it has the limitation that it can only test a single explanatory variable at a time.

Example usage


anovaNP(formula = len ~ dose, data=ToothGrowth)

#  Kruskal-Wallis
#  ───────────────────────────────
#           χ²      df    p
#  ───────────────────────────────
#    len    40.7     2    < .001
#  ───────────────────────────────


data the data as a data frame
deps a string naming the dependent variable in data
group a string naming the grouping or independent variable in data
es TRUE or FALSE (default), provide effect-sizes
pairs TRUE or FALSE (default), perform pairwise comparisons


A results object containing:

results$table a table
results$comparisons an array of tables

Tables can be converted to data frames with asDF or For example:


Elements in arrays can be accessed with [[n]]. For example:

results$comparisons[[1]] # accesses the first element