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

Hi all,

I see many posts on how to customize the KM graph.

However, I just need the basic one and would like to ask if we can customize the vertical axis within PROC LIFETEST?

The codes below will give me a full graph of the survival probability from 0 to 1.

Is there anyway to limit it to 0.8  to 1? That will zoom out the graph.

Thank you!

Hao

 

 

 

ODS html; ODS graphics on;

PROC LIFETEST data=table2 plots=survival (nocensor test atrisk(outside maxlen=13)=0 to 9 by 1) maxtime=9;

TIME time*outcome (0);

STRATA TREATMENT /test=logrank order=internal adjust=sidak;

LABEL TREATMENT ='Legend:';

RUN;

ODS graphics off;

ODS html close;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Have you tried changing the viewmin/viewmax values or the tickvalue list as illustrated in this example from the documentation?

 

https://documentation.sas.com/doc/en/pgmsascdc/v_010/statug/statug_kaplan_sect018.htm

 

Basically you just need to add the following before your code:

%ProvideSurvivalMacros;
%let yOptions = label="Survival"
                linearopts=(viewmin=0.8 viewmax=1
                            tickvaluelist=(0.8 .9 1));

%CompileSurvivalTemplates;

@haoduonge wrote:

Hi all,

I see many posts on how to customize the KM graph.

However, I just need the basic one and would like to ask if we can customize the vertical axis within PROC LIFETEST?

The codes below will give me a full graph of the survival probability from 0 to 1.

Is there anyway to limit it to 0.8  to 1? That will zoom out the graph.

Thank you!

Hao

 

 

 

ODS html; ODS graphics on;

PROC LIFETEST data=table2 plots=survival (nocensor test atrisk(outside maxlen=13)=0 to 9 by 1) maxtime=9;

TIME time*outcome (0);

STRATA TREATMENT /test=logrank order=internal adjust=sidak;

LABEL TREATMENT ='Legend:';

RUN;

ODS graphics off;

ODS html close;


 

View solution in original post

3 REPLIES 3
Reeza
Super User

Have you tried changing the viewmin/viewmax values or the tickvalue list as illustrated in this example from the documentation?

 

https://documentation.sas.com/doc/en/pgmsascdc/v_010/statug/statug_kaplan_sect018.htm

 

Basically you just need to add the following before your code:

%ProvideSurvivalMacros;
%let yOptions = label="Survival"
                linearopts=(viewmin=0.8 viewmax=1
                            tickvaluelist=(0.8 .9 1));

%CompileSurvivalTemplates;

@haoduonge wrote:

Hi all,

I see many posts on how to customize the KM graph.

However, I just need the basic one and would like to ask if we can customize the vertical axis within PROC LIFETEST?

The codes below will give me a full graph of the survival probability from 0 to 1.

Is there anyway to limit it to 0.8  to 1? That will zoom out the graph.

Thank you!

Hao

 

 

 

ODS html; ODS graphics on;

PROC LIFETEST data=table2 plots=survival (nocensor test atrisk(outside maxlen=13)=0 to 9 by 1) maxtime=9;

TIME time*outcome (0);

STRATA TREATMENT /test=logrank order=internal adjust=sidak;

LABEL TREATMENT ='Legend:';

RUN;

ODS graphics off;

ODS html close;


 

haoduonge
Quartz | Level 8

It is so strange, I add that before my codes and the figure does not change a bit.

Hao

haoduonge
Quartz | Level 8

I got it, thank you!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 621 views
  • 0 likes
  • 2 in conversation