BookmarkSubscribeRSS Feed
psh23
Calcite | Level 5

I would like my yaxis values to have two decimal places, this code does not work:

 

proc sgplot data=week noborder;
format HazardRatio 4.2;
scatter x=week y=HazardRatio / yerrorlower=WaldLower
datalabelattrs=(size=12pt color=black)
yerrorupper=WaldUpper errorbarattrs=(color=black)
markerattrs=hr
(symbol=CircleFilled size=6 color=black);
refline 1 / axis=y lineattrs=(pattern=shortdash) transparency=.5;
yaxis label="Hazard Ratio " min=.96 max=1.06 type=log logbase=10
valueattrs=(size=14pt color=black family="Times New Roman") labelattrs=(size=14pt color=black family="Times New Roman");
xaxis label="Week of Gestation" min=1 max=37
valueattrs=(size=14pt color=black family="Times New Roman") labelattrs=(size=14pt color=black family="Times New Roman") minor;
run;

 

Thanks!image.png

2 REPLIES 2
ballardw
Super User

Try the option VALUESFORMAT=4.2 on the YAXIS statement.

psh23
Calcite | Level 5

Thanks! valuesformat=4.2 does not work but valuesformat=data does. 


proc sgplot data=week noborder;
/*format HazardRatio 4.2;*/
scatter x=week y=HazardRatio / yerrorlower=WaldLower
datalabelattrs=(size=12pt color=black)
yerrorupper=WaldUpper errorbarattrs=(color=black)
markerattrs=(symbol=CircleFilled size=6 color=black);
refline 1 / axis=y lineattrs=(pattern=shortdash) transparency=.5;
yaxis valuesformat=data label="Hazard Ratio " min=.96 max=1.06 type=log logbase=10
valueattrs=(size=14pt color=black family="Times New Roman") labelattrs=(size=14pt color=black family="Times New Roman") ;
xaxis label="Week of Gestation" min=1 max=37
valueattrs=(size=14pt color=black family="Times New Roman") labelattrs=(size=14pt color=black family="Times New Roman") minor;
run;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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