jmv

One Way ANOVA (Non-parametric)

Kruskal-Wallis

Example usage

data('ToothGrowth')

anovaNP(ToothGrowth, deps = 'len', group = 'dose')

#
#  One-way ANOVA (Non-parametric)
#
#  Kruskal-Wallis
#  ───────────────────────────────
#           χ²      df    p
#  ───────────────────────────────
#    len    40.7     2    < .001
#  ───────────────────────────────
#

Arguments

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
pairs TRUE or FALSE (default), perform pairwise comparisons

Returns

A results object containing:

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

Tables can be converted to data frames with asDF or as.data.frame(). For example:

results$table$asDF

as.data.frame(results$table)

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

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