- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It is so strange, I add that before my codes and the figure does not change a bit.
Hao
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I got it, thank you!