Cox-Stuart Test

The Cox-Stuart test is a simple test that is used to determine whether a time series has an increasing or decreasing trend.

Suppose the time series is x1, x2, …, xn. Let m = INT(n/2) and define s1, …, sm where si = Sign(xm+i+1xi). We now perform the sign test of this series (using the binomial distribution).

Example

Example 1: Determine whether there is a decreasing trend for the time series in column A of Figure 1.

Cox-Stuart test

Figure 1 – Cox-Stuart Test

The p-value from the test is shown in cell D9 using the binomial distribution (or in cell D11 using the Slope Test). Since p-value = .035156 < .05 = α, we have a significant result provided the time series is decreasing. Since the ratio of positive values to non-negative values in column K is .125 (cell D8), which is less than .5, we can conclude that the time series is indeed decreasing. Note that this is a one-tail test since we specified a decreasing trend.

If we had specified an increasing trend, then clearly we would have a non-significant result (p-value = 1-.035156 = .964844). If we wanted to determine whether there was a trend in either direction, then we would perform a two-tailed test with p-value = 2*.035156 = .070312, which is not significant.

Worksheet Function

Real Statistics Function: The Real Statistics Resource Pack provides the following array function.

COX_STUART(R1, tails): returns a column array with the p-value of the Cox-Stuart test for the data in the column array R1 along with the ratio between positive differences over total differences.

tails = 1 or 2 (default). If ratio < .5 then any trend is decreasing, while if ratio > .5 then any trend is increasing.

Applying this function in range D13:D14, we get the same results as shown above for Example 1.

Data Analysis Tool

The (one-tailed) Cox-Stuart Test can also be performed using the Trend and Change Point Tests data analysis tool, as demonstrated in Sen’s Slope

Links

↑ Misc time series topics

Examples Workbook

Click here to download the Excel workbook with the examples described on this webpage.

Reference

Logos, T. (2009) Trend analysis with Cox-Stuart test in R. R-Blogger
https://www.r-bloggers.com/2009/08/trend-analysis-with-the-cox-stuart-test-in-r/

Leave a Comment