- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
when I turn on ODS graphics, I sometimes do not see any graphs in the output, while other times they appear as expected. I checked the settings under Tools > Options > Preferences and ensured that ODS Graphics is enabled. but I am still experiencing issues with the display of graphs; there are no relevant messages or errors in the log.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
for instance, when I run the below code, it does not show me any graph, and I just see the correlation results.
ods graphics on;
title "Computing Pearson Correlation Coefficients";
proc corr data=exercise nosimple rank;
var Rest_Pulse Max_Pulse Run_Pulse Age;
with Pushups;
run;title;
ods graphics off;
t
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @bhr-q,
You must use the PLOTS= option of the PROC CORR statement to create a graph with this procedure: either plots=scatter or plots=matrix or plots=all (see section ODS Graphics of the procedure documentation and, for more details, the documentation of the PLOTS= option).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your answer, yes I can get the plot with the below code:
proc corr data=exercise nosimple plots = matrix;
var Rest_Pulse Max_Pulse Run_Pulse Age;
with Pushups;
run;
but my question is to get the plot using ODS graphics
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When you specify PLOTS=MATRIX, then PROC CORR does produce the matrix plot of correlations. That plot is done using ODS graphics.
Some procedures produce plots without the use of special options inside the procedure. PROC CORR does not produce that ODS graph without PLOTS=MATRIX on the PROC CORR statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@bhr-q wrote:
my question is to get the plot using ODS graphics
You are using ODS graphics. As you mentioned in your initial post, you had to "turn on ODS graphics" (using the ODS GRAPHICS statement) and this is indeed the prerequisite for the PLOTS= option to work. Otherwise, the warning
WARNING: You must enable ODS graphics before requesting plots.
would be written to the log. The PLOTS= option of PROC CORR was introduced in SAS version 9, as were ODS graphics.