# Mann-Kendall Rank Test

### Description

Performs the Mann-Kendall rank test of randomness.

### Usage

1 | ```
rank.test(x, alternative)
``` |

### Arguments

`x` |
a numeric vector containing the observations |

`alternative` |
a character string specifying the alternative hypothesis. Must be one of " |

### 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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
##
## 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)
``` |