BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Magdal3na
Fluorite | Level 6

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

Use NOCLIP option on the REFLINE statement.

View solution in original post

2 REPLIES 2
Jay54
Meteorite | Level 14

Use NOCLIP option on the REFLINE statement.

Magdal3na
Fluorite | Level 6

Thank you very much!

Somehow, yesterday I didn't find this statement Robot Embarassed

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 645 views
  • 1 like
  • 2 in conversation