Last data update: 2014.03.03

R: Mann-Kendall Rank Test
rank.testR Documentation

Mann-Kendall Rank Test

Description

Performs the Mann-Kendall rank test of randomness.

Usage

rank.test(x, alternative)

Arguments

x

a numeric vector containing the observations

alternative

a character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "left.sided" or "right.sided".

Details

Missing values are removed.

The possible alternative values are "two.sided", "left.sided" and "right.sided" define the alternative hypothesis. By using the alternative "left.sided" the null of randomness is tested against a downward trend. By using the alternative "right.sided" the null hypothesis of randomness is tested against a upward trend.

Value

A list with class "htest" containing the components:

statistic

the value of the normalized statistic test.

parameter

The size n of the data.

p.value

the p-value of the test.

method

a character string indicating the test performed.

data.name

a character string giving the name of the data.

P

the value of the (non normalized) P statistic.

mu

the mean value of the P statistic.

var

the variance of the P statistic.

Author(s)

Ayana Mateus and Frederico Caeiro

References

Brockwell, P.J. and Davis, R.A. (2002). Introduction to Time Series and Forecasting, 2nd edition, Springer (p. 37).

Mann, H.B. (1945). Nonparametric test against trend. Econometrica, 13, 245–259.

Kendall, M. (1990). Rank correlation methods, 5th edition. Oxford University Press, USA.

Examples

##
## Example 1
## Sweet potato yield per acre, 1868-1937 in the United States.
## Available in this package.
##
data(sweetpotato)
rank.test(sweetpotato$yield)

##
## Example 2
## Old Faithful Geyser Data on Eruption time in mins.
## Available in R package datasets.
##
rank.test(faithful$eruptions)

Results