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

This should be easy. I'm trying to make a Bland-Altman plot with a reference line at 0- but the reference line will show at the bottom, I need it centered on the y-axis. 

 

proc sgplot data = EZ3;

refline 0 / axis =Y;

scatter y = difference x = average;

run;

quit;

 

In all examples I'm seeing online this is the (basic) way to do it and the reference line will be centered at 0 on the Y-axis with code like this.

 

For reference, I created a "fake" dataset that is exactly 3 times higher than the original dataset, so what I am looking at looks like a regression line since the 0 is not centered on the y-axis. 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Add a yaxis statement with a value list. Something like

 

yaxis values= (-25 to 25 by 5);

or

yaxis values= (-10 -5 0 5 10);

 

with the range as suitable for your data. That should force an axis with the 0 in the middle

 

 

View solution in original post

4 REPLIES 4
Reeza
Super User

I don't understand what you mean by 'centered at 0 on the Y axis'. Could you provide a sample or visual to help with this?

Estelle
Calcite | Level 5

Attached you will see the Bland-Altman plot on the right, you'll see 0 is centered on the Y-axis. Regression on the left for comparison. R_vs_BA.png

ballardw
Super User

Add a yaxis statement with a value list. Something like

 

yaxis values= (-25 to 25 by 5);

or

yaxis values= (-10 -5 0 5 10);

 

with the range as suitable for your data. That should force an axis with the 0 in the middle

 

 

Estelle
Calcite | Level 5

Thanks! Totally works.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 4 replies
  • 1036 views
  • 2 likes
  • 3 in conversation