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

smk.test

Seasonal Mann-Kendall Trend Test


Description

Performs a Seasonal Mann-Kendall Trend Test (Hirsch-Slack Test)

Usage

smk.test(x, alternative = c("two.sided", "greater", "less"), continuity = TRUE)

Arguments

x

a time series object with class ts comprising >= 2 seasons; NA values are not allowed

alternative

the alternative hypothesis, defaults to two.sided

continuity

logical, indicates, whether a continuity correction should be done; defaults to TRUE

Details

The Mann-Kendall statistic for the $g$-th season is calculated as:

S_g = ∑_{i = 1}^{n-1} ∑_{j = i + 1}^n \mathrm{sgn}≤ft(x_{jg} - x_{ig}\right), \qquad (1 ≤ g ≤ m)

with sgn the signum function (see sign).

The mean of S_g is μ_g = 0. The variance including the correction term for ties is

σ_g^2 = ≤ft\{n ≤ft(n-1\right)≤ft(2n+5\right) - ∑_{j=1}^p t_{jg}≤ft(t_{jg} - 1\right)≤ft(2t_{jg}+5\right) \right\} / 18 ~~ (1 ≤ g ≤ m)

The seasonal Mann-Kendall statistic for the entire series is calculated according to

\begin{array}{ll} \hat{S} = ∑_{g = 1}^m S_g & \hat{σ}_g^2 = ∑_{g = 1}^m σ_g^2 \end{array}

The statistic S_g is approximately normally distributed, with

z_g = S_g / σ_g

If continuity = TRUE then a continuity correction will be employed:

z = \mathrm{sgn}(S_g) ~ ≤ft(|S_g| - 1\right) / σ_g

Value

An object with class "htest" and "smktest"

data.name

character string that denotes the input data

p.value

the p-value for the entire series

statistic

the z quantile of the standard normal distribution for the entire series

null.value

the null hypothesis

estimates

the estimates S and varS for the entire series

alternative

the alternative hypothesis

method

character string that denotes the test

Sg

numeric vector that contains S scores for each season

varSg

numeric vector that contains varS for each season

pvalg

numeric vector that contains p-values for each season

Zg

numeric vector that contains z-quantiles for each season

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, http://dx.doi.org/10.1002/env.507.

R. Hirsch, J. Slack, R. Smith (1982), Techniques of Trend Analysis for Monthly Water Quality Data, Water Resources Research 18, 107–121.

Examples

res <- smk.test(nottem)
## print method
res
## summary method
summary(res)

trend

Non-Parametric Trend Tests and Change-Point Detection

v1.1.4
GPL-3
Authors
Thorsten Pohlert [aut, cre] (<https://orcid.org/0000-0003-3855-3025>)
Initial release
2020-09-17

We don't support your browser anymore

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