BookmarkSubscribeRSS Feed
tnaveen80150
Obsidian | Level 7

Hello,

 

I have a problem that has several dimensions and would like to get to know possible solutions/approaches to solving the problem. I have some experience in using SAS procedures but when it comes to macros, I am pretty much a amateur. 

 

1. I have around 10 pairs of variables (each variable has ~30 datapoints) for which I need to compute non-linear correlation (likely quadratic  or monotonic) for each pair.

2. In addition, I need to compute/assess if any non-linear cross-correlation exists for the pairs. The CROSSCORR functionality allows for, if my understanding is correct, computation of linear association with lags. 

3. The variables/data being studied are temporal in nature. Any serial correlation is compensated for and the non-linear correlation is between the residuals (post serial correlation removal).

 

I am looking for a solution that:

 

1. computes cross-correlation to assess non-linear relationship, if such a thing even exists. Absent that, would regression work in such a scenario, with the R-squared being used in lieu of a correlation/cross-correlation measure?

2. is scalable (I have 30 entities for each of which I need to compute the cross-correlation for 10 pairs of 30 datapoints each).

 

I hope I have provided as much information as ipossible. If there's any more information required, I am happy to provide.

 

Thanks in advance.

 

Addendum: Have added sample data and the expected output. Hope that helps. The attached spreadsheet has 2 tabs: 1 for data and the other for the computed cross-correlation (based on linear association). The cross-correlation was computed using PROC ARIMA. The expectation now is to compute non-linear cross-correlation (monotonic/quadratic), if such a thing is possible.

7 REPLIES 7
Reeza
Super User

Post sample data and what you expect as output.

tnaveen80150
Obsidian | Level 7

Sample data added.

 

Thanks!

Reeza
Super User

Do you have a SAS ETS license? If so, I think PROC TIMESERIES will do this for you automatically. 

 

http://documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_timeseries_syntax06.htm&docsetVersio...

tnaveen80150
Obsidian | Level 7
I am using the Online SAS version for academics, which I believe does provide access to ETS procedures.Having said that, could the cross-correlation computation be rigged to say, compute cross-correlations assuming a monotonic relationship between X and Y based on Spearman's Rho? Or am I understanding this incorrectly ?
Reeza
Super User

TBH I don't understand what that means, but the link above includes what it can calculate for cross correlation, if its not in there then you're likely stuck with writing a custom calculation. 

tnaveen80150
Obsidian | Level 7
Thanks @Reeza. It does seem like probably I may have to do custom calculations/macro programming.

Reeza
Super User

I've moved your post to the Stat's forum and perhaps @Rick_SAS can assist when he has some time 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 2167 views
  • 0 likes
  • 2 in conversation