seaken: Trend Test

View source: R/seaken.R

seakenR Documentation

Trend Test

Description

Computes the seasonal Kendall trend test with Sen slope estimator.

Usage

seaken(series, nseas = 12)

Arguments

series

a regularly spaced numeric vector to test for trend. Missing values are permitted.

nseas

the number of seasons per year. Must not exceed 52. Can also be a character vector of the names of the seasons. The length of the character vector determines the number of seasons.

Value

An object of class "htest" also inhereting class "seaken" containing the following components:

method

a description of the method.

statistic

the value of Kendall's tau.

p.value

the p-value. See Note.

p.value.raw

the p-value computed without correction for serial correlation. See Note.

p.value.corrected

the p-value computed with correction for serial correlation. See Note.

estimate

a named vector containing the Sen estimate of the slope in units per year, the median value of the data, and the median value of time.

data.name

a string containing the actual name of the input series with the number of years and seasons.

alternative

a character string describing alternative to the test ("two.sided").

null.value

the value for the hypothesized slope (0).

nyears

the number of years.

nseasons

the number of seasons.

series

the data that was analyzed.

seasonnames

the names of the seasons.

Note

The value of p.value is p.value.raw if there are fewer than 10 years of data and is p.value.corrected otherwise.

References

Hirsch, R.M., Alexander, R.B., and Smith, R.A., 1991, Selection of methods for the detection and estimation of trends in water quality: Water Resources Research, v. 27, p. 803–813.

Hirsch, R.M., Slack, J.R., and Smith, R.A., 1982, Techniques of trend analysis for monthly water quality data: Water Resources Research, v. 18, p. 107–121.

Hirsch, R.M., and Slack, J.R., 1984, A nonparametric trend test for seasonal data with serial dependence: Water Resources Research, v. 20, p. 727–732.

Kendall, M.G., 1938, A new measure of rank correlation: Biometrika v. 30, p. 81–89.

Kendall, M.G., 1976, Rank correlation methods (4th ed.): London, Griffin, 202 p.

Sen, P.K., 1968, Estimates of regression coefficient based on Kendall's tau: Journal of the American Statisical Association, v. 63, p. 1379–1389.

See Also

kensen.test, regularSeries

Examples

## Not run: 
library(smwrData)
library(smwrBase)
data(KlamathTP)
RegTP <- with(KlamathTP, regularSeries(TP_ss, sample_dt))
# The warning generated is expected and acceptable for these data
seaken(RegTP$Value, 12)
# Manaus river data is in package boot
library(boot)
data(manaus)
manaus.sk <- seaken(manaus, 12)
print(manaus.sk)
# Note for these data the large difference between the raw and corrected p-values.
#  p-value (raw) is << 0.001
manaus.sk$p.value.raw
#  p-value (with correlation correction) is = 0.10
manaus.sk$p.value.corrected
#  Hence, it may be concluded that these particular data show substantial serial correlation
#  as seen with see with acf(manaus).

## End(Not run)

USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.