BookmarkSubscribeRSS Feed

User-friendly SAS application for performing seasonal Kendall’s Trend Analysis (Hirsch et al., 1982)

Started ‎08-02-2021 by
Modified ‎08-02-2021 by
Views 4,519

The seasonal Kendall test (Hirsch et al., 1982) accounts for seasonality by computing the Mann-Kendall test on each of m seasons separately, and then combining the results. Overall Tau is a weighted average of twelve rank-correlation coefficients, one for each month of the year. The P-value accompanying each Tau value is the result of a test of significance for each month. The test of significance of overall Tau is the test for trend. The Overall Tau is much more sensitive than the monthly tests for the simple reason that the overall test is based on a much larger sample (approximately 12 times larger). Thus, it is possible to have an Overall Tau that is significantly different from zero while none of the monthly Tau’s upon which it is based is significant.

 

Slope: The rate of change of each water-quality is quantified by the seasonal Kendall slope estimator (Hirsch, et al.,1982). It has the same robust statistical properties as Tau. Moreover, the test of significance of Tau can also be interpreted as a test of significance of the hypothesis that the median change per year (slope) is different from zero. The Overall Seasonal Kendall Estimate, along with 90% and 95% confidence limits of the change per year, is tabulated. There are 3 kinds of estimates: (1) change per year (slope), (2) percent change per year (percentage of the median) and (3) relative change per year (%).

 

Kendall SAS macro: A user-friendly SAS macro application Kendall, using Microsoft Windowing Environment to perform seasonal trend analysis using seasonal Kendall trend model was published by Tian and Fernandez (1998). However, this originally published macro application is not compatible with SAS Enterprise Guide or SAS studio environment. Therefore, an enhanced user-friendly SAS macro application that is compatible in SAS Display manager, SAS Enterprise Guide, and SAS Studio is developed and presented here.

 

Kendall User-friendly SAS macro application:

First download and unzip the Kendall.zip specified in this post.  SAS version 9.4 for was used to develop this SAS MACRO programs and the relevant MACRO-CALL file for seasonal Kendall’s Trend analysis. The requirements for using this SAS macro are

(1) A valid license to run the SAS software on your PC, and

(2) SAS modules such as SAS/BASE, SAS/IML and SAS/STAT should be licensed to get complete results.

The steps for performing the user-friendly SAS macros are:

 

Step1: Input the permanent SAS data file like the example data file included with the zip file. This data should contain the following variables:

  • Interval Response variable(s) (RESP)
  • Date variable (Date).
  • Optional seasonal variable, MM (month, week).
  • Required Year variable

 Step 2: Submit the SAS macro call file after filling the appropriate macro input

After inputting all required fields (Figure 1), Run the macro-call file. The MACRO-CALL file automatically accesses the SAS Kendall macro from the specified location. After a successful run, this macro will generate following exploratory graphs, Kendall univariate statistics, Kendall overall tau, Kendall seasonal tau and Kendall seasonal slope and confidence intervals.

 

gcjfernandez_gmail_com_0-1627884319377.png

 

Figure 1 Screenshot of Kendall macro-call with acceptable macro inputs.

 

gcjfernandez_gmail_com_1-1627884581873.pnggcjfernandez_gmail_com_2-1627884640833.png

 

gcjfernandez_gmail_com_3-1627884788894.png

 

gcjfernandez_gmail_com_4-1627884857873.pnggcjfernandez_gmail_com_5-1627884928514.png

References

HirschR.M, Slack J.Rand Smith R.A (1982) Techniques of trend analysis for monthly water quality data Water Resources Research 18:107-121.

Tian J and Fernandez G.C.J (1998) Seasonal Trend Analysis of Monthly Water Quality Data 

Western SAS User Conference proceeding paper. https://www.lexjansen.com/wuss/1999/WUSS99049.pdf

 

 

Version history
Last update:
‎08-02-2021 02:27 AM
Updated by:
Contributors

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags