Computes Sen's slope for linear rate of change and corresponding confidence intervalls
sens.slope(x, conf.level = 0.95)
numeric vector or a time series object of class "ts"
numeric, the level of significance
A list of class "htest".
numeric, Sen's slope
character string that denotes the input data
the p-value
the z quantile of the standard normal distribution
the null hypothesis
upper and lower confidence limit
the alternative hypothesis
character string that denotes the test
This test computes both the slope (i.e. linear rate of change) and confidence levels according to Sen's method. First, a set of linear slopes is calculated as follows: $$d_{k} = \frac{x_j - x_i}{j - i}$$
for \(\left(1 \le i < j \le n \right)\), where d is the slope, x denotes the variable, n is the number of data, and i, j are indices.
Sen's slope is then calculated as the median from all slopes: \(b_{Sen} = \textnormal{median}(d_k)\).
This function also computes the upper and lower confidence limits for sens slope.
Hipel, K.W. and McLeod, A.I. (1994), Time Series Modelling of Water Resources and Environmental Systems. New York: Elsevier Science.
Sen, P.K. (1968), Estimates of the regression coefficient based on Kendall's tau, Journal of the American Statistical Association 63, 1379--1389.
# NOT RUN {
data(maxau)
sens.slope(maxau[,"s"])
mk.test(maxau[,"s"])
# }
Run the code above in your browser using DataLab