Can someone tell me how to modify a correlation plot to have the same scale for the x and y axis that begins at the origin?
When I use my current code below, my graph "zooms in", but I want to display it differently.
ods graphics on;
PROC CORR DATA=TBI1 PLOTS=SCATTER(NVAR=all);
VAR D16MWT D26MWT;
RUN;
ods graphics off;
graph:
Thank you in advance!
It sounds like you should use PROC SGPLOT if you want complete control over axes ranges. Compare the following two plots:
proc corr data=sashelp.class plots=scatter;
var weight height;
run;
title "Scatter Plot";
title2 "With 95% Prediction Ellipse";
proc sgplot data=sashelp.class;
scatter x=weight y=height;
ellipse x=weight y=height;
xaxis min=0; /* do you also want MAX=500 ? */
yaxis min=0; /* do you also want MAX=500 ? */
run;
I'm not sure if " the same scale for the x and y axis" means that you also want the maximum value for each axis to be the same. If so, use the MAX= option on the XAXIS and YAXIS statements, as shown in the comments.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.