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
Super User

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
Rhodochrosite | Level 12

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
Super User

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!

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

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
  • 7 replies
  • 3281 views
  • 1 like
  • 4 in conversation