BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tnaveen80150
Obsidian | Level 7

Hello,

 

Being somewhat a new entrant into the world of measures of dependence measurement, I apologize if my question lacks sophistication. I was wondering if there are any procedures yet or any programming methods to compute the Distance correlation and covariance between bivariate data (each dataset comprising a maximum of ~150 datapoints). I see that R has scripts that were suggested by the authors of the distance correlation method (Szekely...); anything equivalent in SAS? 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

There are many ways to compute distances between observations in SAS.

 

The Mahalanobis distance is a correlation/covariance based distance. You can also use PROC DISTANCE to compute various distances in conjunction with PROC PRINCOMP. You can also use PROC PLS to compute the Mahalanobis distance (it is listed as the TSQUARE option for Hotelling's-T2 statistic) You can also compute robust distances by using PROC ROBUSTREG or the MCD function in SAS/IML. If you have spatial data, you can use PROC VARIOGRAM and PROC KRIGE2D to compute various distance-based analyses.

View solution in original post

4 REPLIES 4
art297
Opal | Level 21

Not within SAS itself, at least that I'm aware of, but take a look at: www.lexjansen.com/wuss/2016/19_Final_Paper_PDF.pdf

 

Art, CEO, AnalystFinder.com

 

tnaveen80150
Obsidian | Level 7
Thank you Art. That surely helps me get started. Besides that, I checked out your website and found it useful. So, thanks once more.
Rick_SAS
SAS Super FREQ

There are many ways to compute distances between observations in SAS.

 

The Mahalanobis distance is a correlation/covariance based distance. You can also use PROC DISTANCE to compute various distances in conjunction with PROC PRINCOMP. You can also use PROC PLS to compute the Mahalanobis distance (it is listed as the TSQUARE option for Hotelling's-T2 statistic) You can also compute robust distances by using PROC ROBUSTREG or the MCD function in SAS/IML. If you have spatial data, you can use PROC VARIOGRAM and PROC KRIGE2D to compute various distance-based analyses.

tnaveen80150
Obsidian | Level 7

@Rick_SAS

Thanks for the comprehensive answer!. While it may take me a while to figure out what fits my needs the best, I've got to thank you for guiding me for I know better now which way I should be headed.

In a gist, I seek to assess correlation and cross-correlation between several variables, two variables at a time. The datapoints are temporal in nature. What has been observed is that the residuals of a few such variables, after compensation for trends and autocorrelation effects, possibly have non-linear correlation/cross-correlation.

I only seek a measure of association that is robust to such non-linear associations; Pearson's falls short owing to it sensitivity to linear associations whereas Spearman's is not necessarily sensitive to associations that are not monotonic (e.g. quadratic). In my research (I admit not as deep as it should be), I found distance correlation to be a method that fits my requirements and has shown promising results. This especially so when I cannot visually check residuals on a case-by-case basis owing to the fact that I need to run the test across several datasets.

 

The following research encapsulates in essence what I seek to achieve.

 

MEASURING AND TESTING DEPENDENCE BY CORRELATION OF DISTANCES By Gabor J. Szekely,Maria L. Rizzo and Nail K. Bakirov

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 682 views
  • 2 likes
  • 3 in conversation