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
- /
- SAS Procedures
- /
- Proc corr

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-18-2012 03:16 PM

Hi ,

I have to compute correlation of the aproximately 11000 variables. But Proc Corr has restriction of 3000 variables. Could anybody suggest me, if there is any alternative way to accomplish this task. Could you also provide me the possible SAS code(s).

Shyam

Accepted Solutions

Solution

09-18-2012
11:19 PM

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

09-18-2012 11:19 PM

You can use a macro to walk throught every single variable for all of them , then append them all together.

data x; array _a{*} a1-a11000; do j=1 to 10 ; do i=1 to dim(_a); _a{i}=ranuni(0); end; output; end;drop i j; run; proc corr data=x outp=want1 noprint; var _all_; with a1; run; proc corr data=x outp=want2 noprint ; var _all_; with a2; run; .............. and so on

Ksharp

All Replies

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

09-18-2012 03:57 PM

You could do a series of PROC CORRs with chunks of the variables, output the results and then combine the results to further process them. It is just 16 PROC CORR executions. Che the documentation for how to code it.

I question the wisdom of that many correlations; some of the results will be just spurious noise.

Doc Muhlbaier

Duke

Solution

09-18-2012
11:19 PM

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

09-18-2012 11:19 PM

You can use a macro to walk throught every single variable for all of them , then append them all together.

data x; array _a{*} a1-a11000; do j=1 to 10 ; do i=1 to dim(_a); _a{i}=ranuni(0); end; output; end;drop i j; run; proc corr data=x outp=want1 noprint; var _all_; with a1; run; proc corr data=x outp=want2 noprint ; var _all_; with a2; run; .............. and so on

Ksharp

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

12-27-2012 11:23 AM

Thanks Ksharp for your coding help. Comments form Doc@Duke and PaigeMiller appreciated.

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

09-19-2012 08:39 AM

Doc@Duke said

I question the wisdom of that many correlations; some of the results will be just spurious noise.

This is wise advice. What are you going to do with 11000*10999/2 > 60 million correlations? What is the real problem you are trying to solve with this data?