Calcite | Level 5

## How do i change the Y axis on proc lifetest to percents?

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

## Re: How do i change the Y axis on proc lifetest to percents?

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 🙂

7 REPLIES 7
Rhodochrosite | Level 12

## Re: How do i change the Y axis on proc lifetest to percents?

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)

Calcite | Level 5

## Re: How do i change the Y axis on proc lifetest to percents?

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.

Super User

## Re: How do i change the Y axis on proc lifetest to percents?

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 🙂

Rhodochrosite | Level 12

## Re: How do i change the Y axis on proc lifetest to percents?

@PeterClemmensen, that should work too!

Calcite | Level 5

Thank you!
it worked!

Super User

## Re: How do i change the Y axis on proc lifetest to percents?

Good to hear, was not sure myself 🙂

Fluorite | Level 6

## Re: How do i change the Y axis on proc lifetest to percents?

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

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