Mann-Kendall Trend Test
Performs the Mann-Kendall Trend Test
mk.test(x, alternative = c("two.sided", "greater", "less"), continuity = TRUE)
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 |
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:
S = ∑_{k = 1}^{n-1} ∑_{j = k + 1}^n sgn(x[j] - x[k])
with sgn the signum function (see sign
).
The mean of S is μ = 0. The variance including the correction term for ties is
σ^2 = ≤ft\{n ≤ft(n-1\right)≤ft(2n+5\right) - ∑_{j=1}^p t_j≤ft(t_j - 1\right)≤ft(2t_j+5\right) \right\} / 18
where p is the number of the tied groups in the data set and t_j is the number of data points in the j-th tied group. The statistic S is approximately normally distributed, with
z = S / σ
If continuity = TRUE
then a continuity correction will be employed:
z = sgn(S) * (|S| -1) / σ
The statistic S is closely related to Kendall's τ:
τ = S / D
where
D = ≤ft[\frac{1}{2}n≤ft(n-1\right)- \frac{1}{2}∑_{j=1}^p t_j≤ft(t_j - 1\right)\right]^{1/2} ≤ft[\frac{1}{2}n≤ft(n-1\right) \right]^{1/2}
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 |
Current Version is for complete observations only.
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, http://dx.doi.org/10.1002/env.507.
data(Nile) mk.test(Nile, continuity = TRUE) ## n <- length(Nile) cor.test(x=(1:n),y=Nile, meth="kendall", continuity = TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.