mk.test {trend} | R Documentation |
Mann-Kendall Trend Test
Description
Performs the Mann-Kendall Trend Test
Usage
mk.test(x, alternative = c("two.sided", "greater", "less"), continuity = TRUE)
Arguments
x |
a vector of class "numeric" or a time series object of class "ts" |
alternative |
the alternative hypothesis, defaults to |
continuity |
logical, indicates whether a continuity correction
should be applied, defaults to |
Details
The null hypothesis is that the data come from a population with independent realizations and are identically distributed. For the two sided test, the alternative hypothesis is that the data follow a monotonic trend. The Mann-Kendall test statistic is calculated according to:
with the signum function (see
sign
).
The mean of is
. The variance including the
correction term for ties is
where is the number of the tied groups in the data set and
is the number of data points in the
-th tied group.
The statistic
is approximately normally distributed, with
If continuity = TRUE
then a continuity correction will be employed:
The statistic is closely related to Kendall's
:
where
Value
A list with class "htest"
data.name |
character string that denotes the input data |
p.value |
the p-value |
statistic |
the z quantile of the standard normal distribution |
null.value |
the null hypothesis |
estimates |
the estimates S, varS and tau |
alternative |
the alternative hypothesis |
method |
character string that denotes the test |
Note
Current Version is for complete observations only.
References
Hipel, K.W. and McLeod, A.I. (1994), Time Series Modelling of Water Resources and Environmental Systems. New York: Elsevier Science.
Libiseller, C. and Grimvall, A., (2002), Performance of partial Mann-Kendall tests for trend detection in the presence of covariates. Environmetrics 13, 71–84, doi:10.1002/env.507.
See Also
cor.test
,
MannKendall
,
partial.mk.test
,
sens.slope
Examples
data(Nile)
mk.test(Nile, continuity = TRUE)
##
n <- length(Nile)
cor.test(x=(1:n),y=Nile, meth="kendall", continuity = TRUE)