Learn R Programming

pastecs (version 1.4.2)

trend.test: Test if an increasing or decreasing trend exists in a time series

Description

Test if the series has an increasing or decreasing trend, using a non-parametric Spearman test between the observations and time

Usage

trend.test(tseries, R=1)

Value

A 'htest' object if R=1, a 'boot' object with an added boot$p.value item otherwise

Arguments

tseries

a univariate or multivariate time series (a 'rts' object in Splus or a 'ts' object in R)

R

The number of time the series is/are resampled for a bootstrap test. If R1 (by default), an usual Spearman test is performed. If R > 1 then a bootstrap test is run

Author

Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)

References

Siegel, S. & N.J. Castellan, 1988. Non-parametric statistics. McGraw-Hill, New York. 399 pp.

See Also

local.trend

Examples

Run this code
data(marbio)
trend.test(marbio[, 8])
# Run a bootstrap test on the same series
marbio8.trend.test <- trend.test(marbio[, 8], R=99)
# R=999 is a better value... but it is very slow!
marbio8.trend.test  
plot(marbio8.trend.test)
marbio8.trend.test$p.value

Run the code above in your browser using DataLab