moods.test: Mood's median test

View source: R/stat.R

moods.testR Documentation

Mood's median test

Description

A nonparametric test used to test the equality of medians from two or more populations.

Usage

moods.test(X, ..., exact = TRUE)

Arguments

X

a list of two or more numeric vectors

...

additional parameters passed to fisher.test or chisq.test

exact

logical; if TRUE (default), uses Fisher's exact test and Pearson's chi-squared test otherwise

Details

Mood's median test is an exact test which dichotomizes values in each group above or below the median of the pooled data. The test is conservative in small sample sizes.

Note that this test is different than mood.test in the stats package which tests for a difference in scale parameters rather than medians.

See Also

mood.test; fisher.test; chisq.test; kruskal.test; wilcox.test

Examples

set.seed(1)
X <- list(rnorm(10), rnorm(10, 1), rnorm(20, 2))
moods.test(X)
moods.test(X[1:2], exact = FALSE, correct = TRUE)

plot(density(X[[1]]), xlim = range(unlist(X)), ylim = c(0, .5), main = '')
for (x in 2:3)
  lines(density(X[[x]]), col = x)


raredd/rawr documentation built on April 29, 2024, 10:29 a.m.