Performs the Mann–Kendall trend test on a numeric vector to detect the presence of an increasing or decreasing monotonic trend over time. The test is nonparametric and accounts for tied observations in the data. The null hypothesis assumes there is no monotonic trend.
eda_mk_test(data, alpha = 0.05)
A list containing the test results, including:
data
: The data
argument.
alpha
: The significance level as specified in the alpha
argument.
null_hypothesis
: A string describing the null hypothesis.
alternative_hypothesis
: A string describing the alternative hypothesis.
statistic
: The Mann–Kendall test statistic.
variance
: The variance of the test statistic under the null hypothesis.
p_value
: The p-value associated with the two-sided hypothesis test.
reject
: Logical. If TRUE
, the null hypothesis is rejected at alpha
.
Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.
Numeric scalar in \([0.01, 0.1]\). The significance level for confidence intervals or hypothesis tests. Default is 0.05.
The test statistic \(S\) is the sum over all pairs \(i < j\) of the sign of the difference \(x_j - x_i\). Ties are explicitly accounted for when calculating the variance of \(S\), using grouped frequencies of tied observations. The test statistic \(Z\) is then computed based on the sign and magnitude of \(S\), and the p-value is derived from the standard normal distribution.
Kendall, M. (1975). Rank Correlation Methods. Griffin, London, 202 pp.
Mann, H. B. (1945). Nonparametric Tests Against Trend. Econometrica, 13(3): 245-25
eda_bbmk_test()
data <- rnorm(n = 100, mean = 100, sd = 10)
eda_mk_test(data)
Run the code above in your browser using DataLab