Performs the Mann–Kendall–Sneyers (MKS) test to detect a trend change in annual maximum series data. The test computes normalized progressive and regressive Mann–Kendall statistics and identifies statistically significant crossing points, indicating potential change points. Under the null hypothesis, there are no trend changes.
eda_mks_test(data, years, alpha = 0.05)
A list containing the test results, including:
data
: The data
argument.
years
: The years
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.
progressive_series
: Normalized progressive Mann–Kendall-Sneyers statistics.
regressive_series
: Normalized regressive Mann–Kendall-Sneyers statistics.
bound
: Critical confidence bound for significance based on alpha
.
change_points
: A dataframe of potential change points.
p_value
: Two-sided p-value of the most significant crossing point.
reject
: If TRUE
, the null hypothesis was rejected at significance alpha
.
change_points
contains the years, test statistics, and p-values of each
potential change point. If no change points were identified, change_points
is empty.
Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.
Numeric vector of observation years corresponding to data
.
Must be the same length as data
and strictly increasing.
Numeric scalar in \([0.01, 0.1]\). The significance level for confidence intervals or hypothesis tests. Default is 0.05.
This function computes progressive and regressive Mann–Kendall-Sneyers statistics, normalized by their expected values and variances under the null hypothesis. The crossing points occur when the difference between the progressive and regressive statistics switches sign. The significance of detected crossing points is assessed using the quantiles of the normal distribution.
Sneyers, R. (1990). On the statistical analysis of series of observations. Technical note No. 143, World Meteorological Organization, Geneva.
plot_mks_test()
, eda_pettitt_test()
data <- rnorm(n = 100, mean = 100, sd = 10)
years <- seq(from = 1901, to = 2000)
eda_mks_test(data, years)
Run the code above in your browser using DataLab