- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I ran the following code and got the curve below.
proc lifetest data=sasuser.combine_aim2n2 plots=survival(f) timelist=(0 to 132 by 12);
time month2*ui2(0);
run;
Would there be a way to change the scale of x axis from 0 25 50 75 100 125 to 0 12 24 36 48 60 72 84 96 108 120 132?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @tan-wongv,
@tan-wongv wrote:
Would there be a way to change the scale of x axis from 0 25 50 75 100 125 to 0 12 24 36 48 60 72 84 96 108 120 132?
Yes, I see three ways to do this, the simplest of which is a combination of three survival (plot) options:
- Specify those tick marks in the ATRISK option.
- Add the ATRISKTICKONLY option.
- Make the "At Risk" display invisible by using a tiny proportion in the OUTSIDE option.
proc lifetest data=sasuser.combine_aim2n2 plots=survival(f atrisk(outside(1e-6))=0 to 132 by 12 atrisktickonly); time month2*ui2(0); run;
It is possible, though, that the last tick mark (132) is not displayed if the greatest failure time is less than 132.
The other two ways are more cumbersome:
- Write the data needed for the plot to a dataset (by using the OUTSURV= option of the PROC LIFETEST statement and a subsequent DATA step) and then use PROC SGPLOT to create the plot where you have the XAXIS statement and its various options available.
- Modify a copy of the ODS template underlying the plot, which is Stat.Lifetest.Graphics.ProductLimitFailure. Change the first occurrence of
linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS ...
in the PROC TEMPLATE code to
linearopts=(viewmax=132 tickvaluelist=(0 12 24 36 48 60 72 84 96 108 120 132) ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @tan-wongv,
@tan-wongv wrote:
Would there be a way to change the scale of x axis from 0 25 50 75 100 125 to 0 12 24 36 48 60 72 84 96 108 120 132?
Yes, I see three ways to do this, the simplest of which is a combination of three survival (plot) options:
- Specify those tick marks in the ATRISK option.
- Add the ATRISKTICKONLY option.
- Make the "At Risk" display invisible by using a tiny proportion in the OUTSIDE option.
proc lifetest data=sasuser.combine_aim2n2 plots=survival(f atrisk(outside(1e-6))=0 to 132 by 12 atrisktickonly); time month2*ui2(0); run;
It is possible, though, that the last tick mark (132) is not displayed if the greatest failure time is less than 132.
The other two ways are more cumbersome:
- Write the data needed for the plot to a dataset (by using the OUTSURV= option of the PROC LIFETEST statement and a subsequent DATA step) and then use PROC SGPLOT to create the plot where you have the XAXIS statement and its various options available.
- Modify a copy of the ODS template underlying the plot, which is Stat.Lifetest.Graphics.ProductLimitFailure. Change the first occurrence of
linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS ...
in the PROC TEMPLATE code to
linearopts=(viewmax=132 tickvaluelist=(0 12 24 36 48 60 72 84 96 108 120 132) ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your help!