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!
Try the option VALUESFORMAT=4.2 on the YAXIS statement.
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;
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.
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.