Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rank.test

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)

randtests

Testing randomness in R

v1.0
GPL (>= 2)
Authors
Frederico Caeiro and Ayana Mateus
Initial release
2014-11-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.