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

Description Usage Arguments Value Note Author(s) References See Also Examples

Description

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

Usage

1

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

Value

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

Note

In both cases (normal test with R=1 and bootstrap test), the p-value can be obtained from obj$p.value (see examples)

Author(s)

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

1
2
3
4
5
6
7
8
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

Example output

Loading required package: boot

	Spearman's rank correlation rho

data:  marbio[, 8] and time(marbio[, 8])
S = 43853, p-value = 0.1841
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.1630113 

Warning message:
In cor.test.default(x, time(x), alternative = "two.sided", method = "spearman") :
  Cannot compute exact p-value with ties

BLOCK BOOTSTRAP FOR TIME SERIES

Fixed Block Length of 1 

Call:
tsboot(tseries = x, statistic = test.trend, R = R, l = 1, sim = "fixed")


Bootstrap Statistics :
     original     bias    std. error
t1* 0.1630113 -0.1484903   0.1369158
[1] 0.2020202

pastecs documentation built on May 2, 2019, 3:36 p.m.

Related to trend.test in pastecs...