ods graphics on;
proc lifetest data=matched3 method=km atrisk
plots=(S(test nocensor atrisk=0 to 3000 by 500))
method=km MAXTIME= 3000 intervals=(1 to 3000 by 500);
time period2*outcome2(0);
strata drug/ adjust=sidak test=logrank;run;
ods graphics off;
Would it be possible to adjust the y-axis to start at zero as the above code create a graph with a gap before zero.
Hello @lillymaginta,
I assume you mean the "gap" due to the patients-at-risk table inside the plot. You can use the OUTSIDE suboption to display that table outside the plot, which should resolve the issue with the y-axis except for a small offset (see documentation and for an example Displaying the Patients-at-Risk Table outside the Plot):
plots=(S(test nocensor atrisk(outside(0.15))=0 to 3000 by 500))
You may need to adjust the percentage (0.15=15% of the vertical space) to your requirements or try the default, i.e., omit the "(0.15)".
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.