smk.test | R Documentation |
Performs a Seasonal Mann-Kendall Trend Test (Hirsch-Slack Test)
smk.test(x, alternative = c("two.sided", "greater", "less"), continuity = TRUE)
x |
a time series object with class |
alternative |
the alternative hypothesis, defaults to |
continuity |
logical, indicates, whether a continuity correction
should be done; defaults to |
The Mann-Kendall statistic for the $g$-th season is calculated as:
S_g = \sum_{i = 1}^{n-1} \sum_{j = i + 1}^n
\mathrm{sgn}\left(x_{jg} - x_{ig}\right), \qquad (1 \le g \le m)
with \mathrm{sgn}
the signum function (see sign
).
The mean of S_g
is \mu_g = 0
. The variance including the
correction term for ties is
\sigma_g^2 = \left\{n \left(n-1\right)\left(2n+5\right) -
\sum_{j=1}^p t_{jg}\left(t_{jg} - 1\right)\left(2t_{jg}+5\right) \right\} / 18
~~ (1 \le g \le m)
The seasonal Mann-Kendall statistic for the entire series is calculated according to
\begin{array}{ll}
\hat{S} = \sum_{g = 1}^m S_g &
\hat{\sigma}_g^2 = \sum_{g = 1}^m \sigma_g^2
\end{array}
The statistic S_g
is approximately normally distributed, with
z_g = S_g / \sigma_g
If continuity = TRUE
then a continuity correction will be employed:
z = \mathrm{sgn}(S_g) ~ \left(|S_g| - 1\right) / \sigma_g
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 |
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, \Sexpr[results=rd]{tools:::Rd_expr_doi("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.
res <- smk.test(nottem)
## print method
res
## summary method
summary(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.