BookmarkSubscribeRSS Feed
Kels123
Quartz | Level 8

Hello,

 

I have written a code to plot a survival curve using PROC LIFETEST:

 

proc lifetest data=clean.DATABASE3 plots=survival

(FAILURE atrisk (atrisktick maxlen=13 outside)=0 14 30 90 180 365)  ;

time time1_C*censor1_C(1) ;

run; quit;

 

Because I want to better visualize my time points of particular interest, which are before the 365-day mark, I want to modify my x-axis to end at 365 days. However, I don't know how to do this. I tried using the overlay statement, but I don't think I understand how it is supposed to be used: 

 

proc template;

layout overlay / xaxisopts=(shortlabel=XNAME

                  offsetmin=.05

                  linearopts=(viewmax=365 tickvaluelist=XTICKVALS

                              tickvaluefitpolicy=XTICKVALFITPOL);

endlayout; run;

 

Please help. I just wanted to know the simplest way to modify the x-axis when using PROC LIFETEST.

 

Thanks in advance. 

2 REPLIES 2
djrisks
Barite | Level 11

Hello,

 

Try these xaxisopts and let me know please:

 

xaxisopts=(shortlabel=XNAME

                  offsetmin=.05

                  linearopts=(viewmax=365 TICKVALUESEQUENCE=(start = 1 end = 365 increment = 91) ));

 

This may also work:

 

xaxisopts=(shortlabel=XNAME

                  offsetmin=.05

                  linearopts=(viewmax=370 tickvaluelist=(0 14 30 90 180 365));

 

Many thanks,

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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