Nonparametric test for monotonic trend Within each season based on Kendall's Tau statistic
kendallSeasonalTrendTest(y, ...)# S3 method for default
kendallSeasonalTrendTest(
y,
season,
year,
alternative = "two.sided",
correct = TRUE,
ci.slope = TRUE,
conf.level = 0.95,
independent.obs = TRUE,
data.name = NULL,
season.name = NULL,
year.name = NULL,
parent.of.data = NULL,
subset.expression = NULL,
...
)
# S3 method for data.frame
kendallSeasonalTrendTest(y, ...)
# S3 method for formula
kendallSeasonalTrendTest(y, data = NULL, subset, na.action = na.pass, ...)
# S3 method for matrix
kendallSeasonalTrendTest(y, ...)
A list object with elements for results of the test
an object containing data for the trend test. In the default method, the argument y
must be numeric vector of observations. When y
is a data frame
, all columns must be numeric. When y
is a matrix
, it must be a numeric matrix. In the formula method, y
must be a formula of the form y ~ season + year
, where y
, season
, and year
specify what variables to use for the these arguments in the call to kendallSeasonalTrendTest.default
. Missing (NA
), undefined (NaN
), and infinite (Inf, -Inf
) values are allowed but will be removed.
methods passed to or from other methods
numeric or character vector or a factor indicating the seasons in which the observations in y were taken. The length of season
must equal the length of y
.
numeric vector indicating the years in which the observations in y
were taken. The length of year
must equal the length of y
.
character string indicating the kind of alternative hypothesis. The possible values are "two.sided"
(tau not equal to 0; the default), "less"
(tau less than 0), and "greater"
(tau greater than 0).
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 TRUE
.
logical scalar indicating whether to compute a confidence interval for the slope. The default value is TRUE
.
numeric scalar between 0 and 1 indicating the confidence level associated with the confidence interval for the slope. The default value is 0.95
.
logical scalar indicating whether to assume the observations in y are seially independent. The default value is TRUE
.
character string indicating the name of the data used for the trend test. The default value is deparse(substitute(y))
.
character string indicating the name of the data used for the season. The default value is deparse(substitute(season))
.
character string indicating the name of the data used for the year. The default value is deparse(substitute(year))
.
character string indicating the source of the data used for the trend test.
character string indicating the expression used to subset the data.
specifies an optional data frame, list or environment (or object coercible by as.data.frame
to a data frame) containing the variables in the model. If not found in data
, the variables are taken from environment(formula)
, typically the environment from which kendallTrendTest
is called.
specifies an optional vector specifying a subset of observations to be used.
specifies a function which indicates what should happen when the data contain NAs
. The default is na.pass
.
Perform a nonparametric test for a monotonic trend within each season based on Kendall's tau statistic, and optionally compute a confidence interval for the slope across all seasons.
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.
kendallSeasonalTrendTest(res ~ month + year, tidfitmean)
Run the code above in your browser using DataLab