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

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...

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

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 🙂

View solution in original post

7 REPLIES 7
WarrenKuhfeld
Ammonite | Level 13

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)

ShuliH
Calcite | Level 5

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.

PeterClemmensen
Tourmaline | Level 20

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 🙂

ShuliH
Calcite | Level 5

Thank you!
it worked!

PeterClemmensen
Tourmaline | Level 20

Good to hear, was not sure myself 🙂

ghbg
Fluorite | Level 6

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??

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 5163 views
  • 1 like
  • 4 in conversation