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
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
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).
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
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.
@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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.