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

How do I get proc lifetest to output a graph where I want to start at a time different of zero

1 ACCEPTED SOLUTION

Accepted Solutions
slangan
Obsidian | Level 7

You can start at a different time by specifing the axes options.

 

Below is a modification of a Proc Lifetest example found on UCLA's website (halfway down the page):

http://www.ats.ucla.edu/stat/sas/examples/asa/asa2_may_2006.htm

 

I changed the x-axis to start at 10 rather than 0

 

proc lifetest data=hmohiv noprint;

time time *censor(0);

survival out=Out1 confband=hw;

run;

symbol i=join v=circle r=5 ;

axis1 order = (0 to 1 by .2) label=(a=90 "Survival Probability") minor=none;

axis2 order = (10 to 60 by 10) label = ("Survival Time (Months)") minor=none;

legend label=none value=(h=2 font=swiss 'Kaplan-Meyer' 'HW lower' 'HW upper'

'Pointwise lower' 'Pointwise upper')

position=(top right inside) mode=share cborder=black;

proc gplot data = out1;

plot (survival hw_lcl hw_ucl sdf_lcl sdf_ucl)*time

/legend=legend1 vaxis=axis1 haxis=axis2 overlay;

run;

quit;

View solution in original post

2 REPLIES 2
slangan
Obsidian | Level 7

You can start at a different time by specifing the axes options.

 

Below is a modification of a Proc Lifetest example found on UCLA's website (halfway down the page):

http://www.ats.ucla.edu/stat/sas/examples/asa/asa2_may_2006.htm

 

I changed the x-axis to start at 10 rather than 0

 

proc lifetest data=hmohiv noprint;

time time *censor(0);

survival out=Out1 confband=hw;

run;

symbol i=join v=circle r=5 ;

axis1 order = (0 to 1 by .2) label=(a=90 "Survival Probability") minor=none;

axis2 order = (10 to 60 by 10) label = ("Survival Time (Months)") minor=none;

legend label=none value=(h=2 font=swiss 'Kaplan-Meyer' 'HW lower' 'HW upper'

'Pointwise lower' 'Pointwise upper')

position=(top right inside) mode=share cborder=black;

proc gplot data = out1;

plot (survival hw_lcl hw_ucl sdf_lcl sdf_ucl)*time

/legend=legend1 vaxis=axis1 haxis=axis2 overlay;

run;

quit;

Reeza
Super User
What version of SAS are you on? The options do vary. Regardless I think for setting the min value you're either modifying the template for the survival graph OR creating your own plot from the output data.

The documentation contains detailed examples on how to modify the template here which should work for SAS 9.3+
http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_templt_a0000...

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1453 views
  • 1 like
  • 3 in conversation