BookmarkSubscribeRSS Feed
bentleyousley
Calcite | Level 5

I'm capturing the output of proc lifetest through ods.  I need to customize the tick interval on a survival plot for the x axis such that the ticks have values of 0 to 18 by intervals of 1.5.

 

The lifetest procedure code is:

 

/*** Compute Kaplan Meier Statistics ***/
ods rtf file = "(directory path)\figures\f4_1.rtf"
style=rtf;

ods graphics on;
proc lifetest data = km1
timelist=0 1.5 3 4.5 6 7.5 9 10.5 12 13.5 15 16.5 18
plots = survival(atrisk=0 1.5 3 4.5 6 7.5 9 10.5 12 13.5 15 16.5 18)
;
time months * event(0);
id usubjid;
strata TRT01PN;
title "Kaplan-Meier plot of PFS based on central review - Figure 4.1";
run;
ods graphics off;
ods listing;
run;

 

The at-risk table reports at the proper intervals but the ticks on the plot have intervals of 5 instead of 1.5. How do I make the ticks occur at 1.5 intervals?

 

Thank you for your help!

 

 

 

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

Try the intervals option in proc lifetest

ods rtf file = "(directory path)\figures\f4_1.rtf"
style=rtf;

ods graphics on;
proc lifetest data = km1 intervals=(0 to 18 by 1.5)
timelist=0 1.5 3 4.5 6 7.5 9 10.5 12 13.5 15 16.5 18
plots = survival(atrisk=0 1.5 3 4.5 6 7.5 9 10.5 12 13.5 15 16.5 18)
;
time months * event(0);
id usubjid;
strata TRT01PN;
title "Kaplan-Meier plot of PFS based on central review - Figure 4.1";
run;
ods graphics off;
ods listing;
run;

 

Thanks,
Jag
bentleyousley
Calcite | Level 5

Thank you for responding. I tried your suggestion but the x axis still shows intervals of 5 instead of 1.5.

Jagadishkatam
Amethyst | Level 16
it is strange i thought it will work. Could you please comment the timelist and try once.
Thanks,
Jag
bentleyousley
Calcite | Level 5

Thank you for responding. I completely removed the timelist from the code. I'm still seeing the same interval of 5.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 4 replies
  • 6199 views
  • 0 likes
  • 2 in conversation