Hello,
I am trying to change the Y axis from proportion (between 0 to 1) to percent (between 0% to 100%) on the proc lifetest without success. I understand how to use the proc template even in the Failure graph and managed to change the minimum, the maximum and the tickvaluelist of the Y axis on the next statement in proc template:
"
yaxisopts=(label="Probability to &XXX" shortlabel="Failure"
linearopts=(viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)))
"
but when I try to change it to:
"
yaxisopts=(label="Probability to &XXX" shortlabel="Failure"
linearopts=(viewmin=0 viewmax=100 tickvaluelist=(0 20 40 60 80 100)))
"
it changes the Y axis but the line of the graph ranges from 0 to 1.
any suggestion on how to solve this?
I know that in the Gplot graph I can use the format for the Y axis. But it's not working here either...
I'm not entirely sure on this one, but can't you simply edit the TICKVALUEFORMAT option instead of editing the actual values?
Correct me if I'm wrong @WarrenKuhfeld 🙂
I don't remember the variable off hand, but if it is Y, and it appears like this:Y=Y
Then change it to Y=eval(100*Y)
Thanks for the response,
in this graph the Y is calculated cumulatively from the cases that appear in the X so I can't use this option.
I'm not entirely sure on this one, but can't you simply edit the TICKVALUEFORMAT option instead of editing the actual values?
Correct me if I'm wrong @WarrenKuhfeld 🙂
@PeterClemmensen, that should work too!
Thank you!
it worked!
Good to hear, was not sure myself 🙂
I am having the same problem as the original poster, but I cannot get the TICKVALUEFORMAT option to work.
I want the y-axis of a KM survival curve to display percentages from 0 to 100%, in intervals of 10%.
I am not using gplot graph to make the graph, I am using proc lifetest.
I am using the following modifications to the %ProvideSurvivalMacros template:
%ProvideSurvivalMacros
%let yOptions = label="Survival (%)"
linearopts=(viewmin=0 viewmax=1
tickvaluelist=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1)
tickvalueformat ??? );
%CompileSurvivalTemplates
proc lifetest data=mydata plots=survival(atrisk test nocensor outside);
time days * event(0);
run;
I don't know what to put in place of "???" after tickvalueformat to make it work
Any ideas??
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.