Hi! I'm relatively new to SAS and have been provided with code under PROC GPLOT, which doesn't work in my sas university edition. I'm trying to transform the code into a PROC SGPLOT step and am a little unclear on what else I should include/change to make sure the graph in my output matches what it would be under gplot. I'm using SAS Studio Version 9.4.
The gplot code is this:
PROC GPLOT data = Work.HW1;
PLOT chol*wtkg=1 chol*wtkg=2 / OVERLAY VAXIS =axis1;
SYMBOL1 INTERPOL=rlcli COLOR=black VALUE=dot;
SYMBOL2 INTERPOL=rlclm COLOR=black VALUE=dot;
AXIS1 LABEL = (FONT=ARIAL HEIGHT= 1.5 ANGLE=90 POSITION=center);
RUN;
and here is what I have for my sgplot code so far:
PROC SGPLOT DATA=Work.HW1; series y=chol x=wtkg; xaxis LABELPOS=center; RUN;
Any help would be greatly appreciated, thank you!!
You should get a decent looking graph with a regression plot :
proc sgplot data=HW1;
reg y=chol x=wtkg / cli clm lineattrs=(color=black pattern=solid) markerattrs=(symbol=circlefilled);
run;
There are lots of options to customize the plot.
@ell_m wrote:
Hi! I'm relatively new to SAS and have been provided with code under PROC GPLOT, which doesn't work in my sas university edition. I'm trying to transform the code into a PROC SGPLOT step and am a little unclear on what else I should include/change to make sure the graph in my output matches what it would be under gplot. I'm using SAS Studio Version 9.4.
The gplot code is this:
PROC GPLOT data = Work.HW1; PLOT chol*wtkg=1 chol*wtkg=2 / OVERLAY VAXIS =axis1; SYMBOL1 INTERPOL=rlcli COLOR=black VALUE=dot; SYMBOL2 INTERPOL=rlclm COLOR=black VALUE=dot; AXIS1 LABEL = (FONT=ARIAL HEIGHT= 1.5 ANGLE=90 POSITION=center); RUN;
and here is what I have for my sgplot code so far:
PROC SGPLOT DATA=Work.HW1; series y=chol x=wtkg; xaxis LABELPOS=center; RUN;Any help would be greatly appreciated, thank you!!
Your old SAS/Graph symbol statement interpolation options RLCLI and RLCLM are asking for regression plots. The first requests showing the confidence limits of the individual y values and the second the confidence limits of the mean of the y values.
So the changes to SGPLOT as @PGStats shows allow requesting both at one time.
You could specify attributes for each of the limit types such as line color or pattern with the CLIATTRS, for the confidence limits of individual values, or CLMATTRS for the confidence limits of the mean.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.