Hello All,
Currently I'm doing Bland-Altman Plots for many variables so I'm using a macro. My problem is that sometimes the upper and lower limits are not included in the plot. SAS sets the y-Axis automatically, but does not include the reflines I'm defining in the sgplot procedure. My question now is: how can I force SAS to include the limits in every plot?
I already tried setting the yaxis min=lower and max=upper. However, some of the plots are cut off to early, not showing all the data points lying outside the confidence limits.
Setting the yaxis separately for every plot is not an option.
I want SAS to define the y-axis automatically as it usually does, while including not only all data points, but the upper and lower limits as well.
What statement could I use for gaining the desired plot?
I am thankful for any help and information.
I'm using SAS 9.4 (TS1M2).
Kind regards,
Magdalena
Here is the sgplot part of my macro:
ods graphics / AttrPriority=None width=11.35cm height=8.49cm;
proc sgplot data=differs ; where Group='1';
styleattrs datasymbols=( Diamond)
datacontrastcolors=(Peru);
scatter x=mean y=diff/ group=abc;
refline &mean /lineattrs=(color=green thickness=2px) ;
refline &upper &lower /lineattrs=(color=red );
run ; ods graphics off;
Use NOCLIP option on the REFLINE statement.
Use NOCLIP option on the REFLINE statement.
Thank you very much!
Somehow, yesterday I didn't find this statement
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.