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.
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?
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.
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.