Learn R Programming

onewaytests (version 1.1)

mood.test: A Function to Perform Mood's Median Test

Description

mood.test performs Mood's median test.

Usage

mood.test(y, group, na.rm = TRUE)

Arguments

y
a numeric vector of data values.
group
a vector or factor object giving the group for the corresponding elements of y.
na.rm
a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

A list with class "htest" containing the following components:
statistic
the Mood's Median test statistic.
parameter
the parameter(s) of the approximate chi-squared distribution of the test statistic.
p.value
the p-value of the test.

References

Brown, G. W., Mood, A. M. (1951). On Median Tests for Linear Hypotheses. Proceedings of the Second Berkeley Symposium on Mathematical Statististics and Probility, University of California Press, 159-166.

Examples

Run this code

mood.test(iris$Sepal.Width,iris$Species)

Run the code above in your browser using DataLab