sens.slope: Sen's slope

View source: R/sens.slope.R

sens.slopeR Documentation

Sen's slope

Description

Computes Sen's slope for linear rate of change and corresponding confidence intervalls

Usage

sens.slope(x, conf.level = 0.95)

Arguments

x

numeric vector or a time series object of class "ts"

conf.level

numeric, the level of significance

Details

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.

Value

A list of class "htest".

estimates

numeric, Sen's slope

data.name

character string that denotes the input data

p.value

the p-value

statistic

the z quantile of the standard normal distribution

null.value

the null hypothesis

conf.int

upper and lower confidence limit

alternative

the alternative hypothesis

method

character string that denotes the test

Note

Current Version is for complete observations only.

References

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.

Examples

data(maxau)
sens.slope(maxau[,"s"])
mk.test(maxau[,"s"])


trend documentation built on Oct. 10, 2023, 9:06 a.m.