turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Computation of Distance Correlation and Covariance

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-24-2018 07:28 PM

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?

Accepted Solutions

Solution

01-30-2018
11:58 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to tnaveen80150

01-25-2018 09:05 AM

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.

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to tnaveen80150

01-24-2018 08:21 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to art297

01-24-2018 10:25 PM

Thank you Art. That surely helps me get started. Besides that, I checked out your website and found it useful. So, thanks once more.

Solution

01-30-2018
11:58 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to tnaveen80150

01-25-2018 09:05 AM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

01-25-2018 05:21 PM - edited 01-25-2018 05:37 PM

@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