kendall: Kendall tau trend with continuity correction for time-series

View source: R/kendall.R

kendallR Documentation

Kendall tau trend with continuity correction for time-series

Description

Calculates a nonparametric statistic for a monotonic trend based on the Kendall tau statistic and the Theil-Sen slope modification

Usage

kendall(
  y,
  tau = TRUE,
  intercept = TRUE,
  p.value = TRUE,
  confidence = TRUE,
  method = c("zhang", "yuepilon", "none"),
  threshold = 6,
  ...
)

Arguments

y

A vector representing a timeseries with >= 8 obs

tau

(FALSE/TRUE) return tau values

intercept

(FALSE/TRUE) return intercept values

p.value

(FALSE/TRUE) return p.values

confidence

(FALSE/TRUE) return 95 pct confidence levels

method

Method for deriving tau and slope ("zhang", "yuepilon", "none")

threshold

The threshold for number of minimum observations in the time-series

...

Not used

Details

This function implements Kendall's nonparametric test for a monotonic trend using the Theil-Sen (Theil 1950; Sen 1968; Siegel 1982) method to estimate the slope and related confidence intervals. Critical values are Z > 1.96 representing a significant increasing trend and a Z < -1.96 a significant decreasing trend (p < 0.05). The null hypothesis can be rejected if Tau = 0. Autocorrelation in the time-series is addressed using a prewhitened linear trend following the Zhang et al., (2000) or Yue & Pilon (2002) methods. If you do not have autocorrelation in the data, the "none" or "yuepilon" method is recommended. Please note that changing the threshold to fewer than 6 observations (ideally 8) may prevent the function from failing but, will likely invalidate the statistic. A threshold of <=4 will yield all NA values. If method= "none" a modification of the EnvStats::kendallTrendTest code is implemented.

Value

Depending on arguments, a vector containing:

  • Theil-Sen slope, always returned

  • Kendall's tau two-sided test, if tau TRUE

  • intercept for trend if intercept TRUE

  • p value for trend fit if p.value TRUE

  • lower confidence level at 95-pct if confidence TRUE

  • upper confidence level at 95-pct if confidence TRUE

Author(s)

Jeffrey S. Evans jeffrey_evans@tnc.org

References

Theil, H. (1950) A rank invariant method for linear and polynomial regression analysis. Nederl. Akad. Wetensch. Proc. Ser. A 53:386-392 (Part I), 53:521-525 (Part II), 53:1397-1412 (Part III).

Sen, P.K. (1968) Estimates of Regression Coefficient Based on Kendall's tau. Journal of the American Statistical Association. 63(324):1379-1389.

Siegel, A.F. (1982) Robust Regression Using Repeated Medians. Biometrika, 69(1):242-244

Yue, S., P. Pilon, B. Phinney and G. Cavadias, (2002) The influence of autocorrelation on the ability to detect trend in hydrological series. Hydrological Processes, 16: 1807-1829.

Zhang, X., Vincent, L.A., Hogg, W.D. and Niitsoo, A., (2000) Temperature and Precipitation Trends in Canada during the 20th Century. Atmosphere-Ocean 38(3): 395-429.

See Also

zyp.trend.vector for model details

Examples

data(EuStockMarkets)
d <- as.vector(EuStockMarkets[,1])
kendall(d)


spatialEco documentation built on Nov. 18, 2023, 1:13 a.m.