Learn R Programming

wq (version 0.4.3)

seaKen: Seasonal and Regional Kendall test

Description

Calculates the Seasonal or Regional Kendall test of significance, including an estimate of the Sen slope.

Usage

seaKen(x)

seaRoll(x, w = 5, rule = 2, plot = FALSE, ylab = NULL, legend = FALSE)

Arguments

Value

seaKen returns a list with the following members:sen.slopeSen slopesen.slope.pctSen slope as percent of meanp.valuesignificance of slopemissfor each season, the fraction missing of slopes connecting first and last 20% of the yearsseaRoll returns a matrix with one row per time window containing the Sen slope, the corresponding percent, and the p-value. Rows are labelled with the leading year of the window.

Rdversion

1.1

Details

The Seasonal Kendall tests were introduced by Hirsch et al. (1982) and are further described by Helsel and Hirsch (2002). The p-values provided here are the raw values, not the ones corrected for serial correlation among seasons. In any case, the raw values are recommended for series lengths less than 10 years.

The function seaRoll applies seaKen to rolling time windows of width w. A minimum w of five years is required. The only rules currently implemented are: (1) ignore missing data; and (2) report a result only if more than half the seasons are each missing less than half the possible comparisons between the first and last 20% of the years (Schertz et al. [1991] discuss these and related decisions about missing data).

If plot = TRUE in the latter function, a point plot will be drawn with the Sen slope plotted at the leading year of the trend window. Filled circles indicate p-value < 0.01, and a legend will be drawn if requested.

Both functions can be used in conjunction with mts2ts to calculate a Regional Kendall test of significance for annualized data, along with a regional estimate of trend (Helsel and Frans 2006). See the examples below.

References

Helsel, D.R. and Hirsch, R.M. (2002) Statistical methods in water resources. Techniques of Water Resources Investigations, Book 4, chapter A3. U.S. Geological Survey. 522 pages. http://pubs.usgs.gov/twri/twri4a3/

Helsel, D.R. and Frans, L. (2006) Regional Kendall test for trend. Environmental Science and Technology 40(13), 4066-4073.

Hirsch, R.M., Slack, J.R., and Smith, R.A. (1982) Techniques of trend analysis for monthly water quality data. Water Resources Research 18, 107-121.

Schertz, T.L., Alexander, R.B., and Ohe, D.J. (1991) The computer program EStimate TREND (ESTREND), a system for the detection of trends in water-quality data. Water-Resources Investigations Report 91-4040, U.S. Geological Survey.

See Also

mts2ts, trendHomog

Examples

Run this code
chl27 <- sfbayChla[, 's27']
seaKen(chl27)
seaRoll(chl27)
seaRoll(chl27, plot = TRUE, legend = TRUE)
chl <-sfbayChla
seaKen(mts2ts(chl))  # too much missing data
seaKen(mts2ts(chl, seas = 2:4))  # better when just Feb-Apr, spring 
    # bloom period, but last 4 stations still missing too much data.
seaKen(mts2ts(chl[, 1:12], 2:4))  # more reliable result

Run the code above in your browser using DataLab