kendallTrendTest {WRTDStidal} | R Documentation |
Kendall trend test
Description
Nonparametric test for monotonic trend based on Kendall's Tau statistic
Usage
kendallTrendTest(y, ...)
## Default S3 method:
kendallTrendTest(
y,
x = seq(along = y),
alternative = "two.sided",
correct = TRUE,
ci.slope = TRUE,
conf.level = 0.95,
warn = TRUE,
data.name = NULL,
data.name.x = NULL,
parent.of.data = NULL,
subset.expression = NULL,
...
)
## S3 method for class 'formula'
kendallTrendTest(y, data = NULL, subset, na.action = na.pass, ...)
Arguments
y |
an object containing data for the trend test. In the default method, the argument |
... |
methods passed to or from other methods |
x |
numeric vector of "predictor" values. The length of |
alternative |
character string indicating the kind of alternative hypothesis. The possible values are |
correct |
logical scalar indicating whether to use the correction for continuity in computing the z-statistic that is based on the test statistic S'. The default value is |
ci.slope |
logical scalar indicating whether to compute a confidence interval for the slope. The default value is |
conf.level |
numeric scalar between 0 and 1 indicating the confidence level associated with the confidence interval for the slope. The default value is |
warn |
logical scalar indicating whether to print a warning message when |
data.name |
character string indicating the name of the data used for the trend test. The default value is |
data.name.x |
character string indicating the name of the data used for the predictor variable |
parent.of.data |
character string indicating the source of the data used for the trend test. |
subset.expression |
character string indicating the expression used to subset the data. |
data |
specifies an optional data frame, list or environment (or object coercible by |
subset |
specifies an optional vector specifying a subset of observations to be used. |
na.action |
specifies a function which indicates what should happen when the data contain |
Details
kendallTrendTest
performs Kendall's nonparametric test for a monotonic trend, which is a special case of the test for independence based on Kendall's tau statistic (see cor.test
). The slope is estimated using the method of Theil (1950) and Sen (1968). When ci.slope=TRUE
, the confidence interval for the slope is computed using Gilbert's (1987) Modification of the Theil/Sen Method.
Kendall's test for a monotonic trend is a special case of the test for independence based on Kendall's tau statistic. The first section below explains the general case of testing for independence. The second section explains the special case of testing for monotonic trend. The last section explains how a simple linear regression model is a special case of a monotonic trend and how the slope may be estimated.
Value
A list object with elements for results of the test
References
Hirsch, R.M., Slack, J.R., Smith, R.A. 1982. Techniques of trend analysis for monthly water quality data. Water Resources Research, 18:107-121.
Millard, S. P. 2013. EnvStats: An R Package for Environmental Statistics. Springer, New York.
Examples
kendallTrendTest(res ~ dec_time, tidfitmean)