- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 06-02-2008 05:15 PM
(2978 views)
How can I obtain the correlation matrix of several variables in SAS EG? Or a matrix plot like the one provided in minitab?
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you have SAS 9.2, then you can get this with some code and the new ODS graphics cababilities.
[pre]
ods graphics on;
proc corr data=sashelp.cars;
var enginesize weight;
with mpg_city mpg_highway;
run;
ods graphics off;
[/pre]
If you have EG 4.1 and SAS 9.2 on the same Windows machine, this code will work. EG 4.2 will use the ODS graphics automatically within the Correlations task. I've attached a sample of the output plot (if the forum software will allow you to view it...)
Chris
[pre]
ods graphics on;
proc corr data=sashelp.cars;
var enginesize weight;
with mpg_city mpg_highway;
run;
ods graphics off;
[/pre]
If you have EG 4.1 and SAS 9.2 on the same Windows machine, this code will work. EG 4.2 will use the ODS graphics automatically within the Correlations task. I've attached a sample of the output plot (if the forum software will allow you to view it...)
Chris
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See this thread from January on how to accomplish the same thing with EG 4.1 and SAS 9.1.3.
http://support.sas.com/forums/thread.jspa?messageID=9148⎼
http://support.sas.com/forums/thread.jspa?messageID=9148⎼
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Doc is right (of course)! Many procedures have ODS graphics support in 9.1.3, but all labeled as "experimental" -- and I couldn't remember which procedures were included.
Here is the relevant doc example for PROC CORR:
http://support.sas.com/onlinedoc/913/getDoc/en/procstat.hlp/corr_sect32.htm
Chris
Here is the relevant doc example for PROC CORR:
http://support.sas.com/onlinedoc/913/getDoc/en/procstat.hlp/corr_sect32.htm
Chris
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
And one of the things that changed in 9.2 is the syntax. So, if you are considering going to 9.2 soon you may want to compare the documentation so fewer things "break" when you do the upgrade.