Learn R Programming

trend (version 1.1.6)

cs.test: Cox and Stuart Trend Test

Description

Performes the non-parametric Cox and Stuart trend test

Usage

cs.test(x)

Value

An object of class "htest"

method

a character string indicating the chosen test

data.name

a character string giving the name(s) of the data

statistic

the Cox-Stuart z-value

alternative

a character string describing the alternative hypothesis

p.value

the p-value for the test

Arguments

x

a vector or a time series object of class "ts"

Details

First, the series is devided by three. It is compared, whether the data of the first third of the series are larger or smaller than the data of the last third of the series. The test statistic of the Cox-Stuart trend test for \(n > 30\) is calculated as:

$$z = \frac{|S - \frac{n}{6}|}{\sqrt{\frac{n}{12}}}$$

where \(S\) denotes the maximum of the number of signs, i.e. \(+\) or \(-\), respectively. The \(z\)-statistic is normally distributed. For \(n \le 30\) a continuity correction of \(-0.5\) is included in the denominator.

References

L. Sachs (1997), Angewandte Statistik. Berlin: Springer.

C.-D. Schoenwiese (1992), Praktische Statistik. Berlin: Gebr. Borntraeger.

D. R. Cox and A. Stuart (1955), Quick sign tests for trend in location and dispersion. Biometrika 42, 80-95.

See Also

mk.test

Examples

Run this code
## Example from Schoenwiese (1992, p. 114)
## Number of frost days in April at Munich from 1957 to 1968
## z = -0.5, Accept H0
frost <- ts(data=c(9,12,4,3,0,4,2,1,4,2,9,7), start=1957)
cs.test(frost)

## Example from Sachs (1997, p. 486-487)
## z ~ 2.1, Reject H0 on a level of p = 0.0357
x <- c(5,6,2,3,5,6,4,3,7,8,9,7,5,3,4,7,3,5,6,7,8,9)
cs.test(x)

cs.test(Nile)

Run the code above in your browser using DataLab