BookmarkSubscribeRSS Feed
Captina
Calcite | Level 5

Hello,

 

I need help writing a code that will help me identify trends in water quality data over time. Several people have recommended Mann Kendall /  kendalls tau but I'm having trouble getting the code to work. An example of the data set will be Date (MM/DD/YYYY) and then the numeric water quality data. Thank you.

3 REPLIES 3
ballardw
Super User

At least provide the code that you ran and the output that makes you think "it didn't work".

You are very likely to get a basic syntax example that could well duplicate what you did. So providing what you did will prevent getting the exact same code as an example.

 

So you have data measured at dates. Do you have multiple measurements on the same date? Are they for different or same sites?

Are the date intervals constant (every 5 days for example) or do they they vary?

Captina
Calcite | Level 5

Ballardw, thanks for the quick response. The code I used was:

 

input day pH;
run;

 

proc corr data=river kendall;
var day; with pH;
run;

 

It produced two numbers for kendalls tau a -0.348 and then below it a 0.0070

 

We have 21 sites which were sampled every four weeks so we technically have 21 values for each sampling date. The code above was used for 1 site (30 observations) to test that it worked before being used for the entire data set.

PGStats
Opal | Level 21

As the result table heading suggests

 

                      Kendall Tau b Correlation Coefficients
                           Prob > |tau| under H0: Tau=0
                              Number of Observations

The top number is the value of the correlation and below is the value of its significance. Calculation details are here.

 

 

Your data should be arranged in three columns (site time pH), sorted by site and time, so that you can request a correlation analysis BY SITE; 

PG

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2488 views
  • 0 likes
  • 3 in conversation