<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic proc lifetest: how to modify KM graph in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977245#M46215</link>
    <description>&lt;P&gt;Dear&lt;/P&gt;&lt;P&gt;I would like to customize the Kaplan-Meier graph by removing the default title &lt;EM&gt;“Product-Limit Survival Estimates with Number of Subjects at Risk.”&lt;/EM&gt; Is it possible to do this directly ?&lt;/P&gt;&lt;P&gt;Should I modify the &lt;STRONG&gt;survival/failure template&lt;/STRONG&gt; to achieve this, or is there another recommended approach?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChiSAS25_0-1760700907505.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110711i9934EAB62D9F2608/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChiSAS25_0-1760700907505.png" alt="ChiSAS25_0-1760700907505.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for any help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Oct 2025 11:38:23 GMT</pubDate>
    <dc:creator>ChiSAS25</dc:creator>
    <dc:date>2025-10-17T11:38:23Z</dc:date>
    <item>
      <title>proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977245#M46215</link>
      <description>&lt;P&gt;Dear&lt;/P&gt;&lt;P&gt;I would like to customize the Kaplan-Meier graph by removing the default title &lt;EM&gt;“Product-Limit Survival Estimates with Number of Subjects at Risk.”&lt;/EM&gt; Is it possible to do this directly ?&lt;/P&gt;&lt;P&gt;Should I modify the &lt;STRONG&gt;survival/failure template&lt;/STRONG&gt; to achieve this, or is there another recommended approach?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChiSAS25_0-1760700907505.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110711i9934EAB62D9F2608/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChiSAS25_0-1760700907505.png" alt="ChiSAS25_0-1760700907505.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for any help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 11:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977245#M46215</guid>
      <dc:creator>ChiSAS25</dc:creator>
      <dc:date>2025-10-17T11:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977246#M46216</link>
      <description>&lt;P&gt;Try the following SAS Note:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/70/375.html" target="_self"&gt;https://support.sas.com/kb/70/375.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 11:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977246#M46216</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-10-17T11:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977265#M46217</link>
      <description>&lt;P&gt;Another possibility, which will also give you control over things like the range of the y-axis and most other customizations is to output the survival dataset by adding the OUTSURV= option to the PROC LIFETEST statement.&amp;nbsp; You'll then be able to plot things with PROC SGPLOT or similar.&amp;nbsp; That said, you will then be doing everything from scratch, including adding text for the log rank / wilcoxon to the plot, displaying censored values, etc., so if you truly only want control over the title, definitely go with the response above this one.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 14:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977265#M46217</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-10-17T14:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977400#M46220</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Dear,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thank you for your helpful note.&lt;/P&gt;&lt;P&gt;I’ve read and tried to apply the SAS guidance you shared. Unfortunately, I’m unable to execute the %grtitle(...) command due to insufficient authorization.&lt;/P&gt;&lt;P&gt;As an alternative, I proceeded to modify the Kaplan-Meier template directly. However, I’m still encountering an issue: the default title &lt;EM&gt;“Number of Subjects at Risk”&lt;/EM&gt; continues to appear in the graph&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChiSAS25_0-1760957900783.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110755i7209E00F612BFEB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChiSAS25_0-1760957900783.png" alt="ChiSAS25_0-1760957900783.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;despite having updated the relevant section of the template as follows:&lt;/P&gt;&lt;P&gt;%if &amp;amp;ntitles gt 1 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if not &amp;amp;outside %then if (PLOTATRISK=1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entrytitle "" /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textattrs=GRAPHVALUETEXT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if not &amp;amp;outside %then %do; endif; %end;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;The title still appears as shown in the screenshot I posted.&lt;BR /&gt;Do you have any suggestions on how to fully suppress or remove it?&lt;/P&gt;&lt;P&gt;Thanks again for your support!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 10:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977400#M46220</guid>
      <dc:creator>ChiSAS25</dc:creator>
      <dc:date>2025-10-20T10:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977401#M46221</link>
      <description>&lt;P&gt;Before I retired, I wrote an entire chapter on modifying the survival plot. I hope you find it helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 11:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977401#M46221</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2025-10-20T11:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977407#M46222</link>
      <description>&lt;P&gt;Thank you very much for your help. I’ve found a solution for the survival analysis. In the coming days, I’ll look into the failure analysis as well, and I hope I’ll be able to make it work.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 12:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977407#M46222</guid>
      <dc:creator>ChiSAS25</dc:creator>
      <dc:date>2025-10-20T12:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977438#M46223</link>
      <description>&lt;P&gt;Glad I could help. The macros provided in the chapter only work to modify the survival plot. If you want to modify the failure plot, you have to modify the template.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the survival plot, there were two templates. You might have been modifying the wrong one, which might be why your first approach did not work. I did not check your work, but keep that in mind if you ever need to modify the template. I suspect there are two failure-plot templates, but again, I did not check. I always used trace output to tell me which template to modify.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 15:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977438#M46223</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2025-10-20T15:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc lifetest: how to modify KM graph</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977497#M46224</link>
      <description>&lt;P&gt;Actually ,you could save these data from PROC LIFETEST and plot it again by PROC SGPLOT.&lt;/P&gt;
&lt;P&gt;Here is a example for SURVIVAL and FAILURE plot:&lt;/P&gt;
&lt;PRE&gt;proc format;
   value grpLabel 1='ALL' 2='AML low risk' 3='AML high risk';
run;

data BMT;
        input DIAGNOSIS Ftime Status Gender@@;
        label Ftime="Days";
        format Diagnosis grpLabel.;
datalines;
1       2081       0       1       1       1602    0       1
1       1496       0       1       1       1462    0       0
1       1433       0       1       1       1377    0       1
1       1330       0       1       1       996     0       1
1       226        0       0       1       1199    0       1
1       1111       0       1       1       530     0       1
1       1182       0       0       1       1167    0       0
1       418        2       1       1       383     1       1
1       276        2       0       1       104     1       1
1       609        1       1       1       172     2       0
1       487        2       1       1       662     1       1
1       194        2       0       1       230     1       0
1       526        2       1       1       122     2       1
1       129        1       0       1       74      1       1
1       122        1       0       1       86      2       1
1       466        2       1       1       192     1       1
1       109        1       1       1       55      1       0
1       1          2       1       1       107     2       1
1       110        1       0       1       332     2       1
2       2569       0       1       2       2506    0       1
2       2409       0       1       2       2218    0       1
2       1857       0       0       2       1829    0       1
2       1562       0       1       2       1470    0       1
2       1363       0       1       2       1030    0       0
2       860        0       0       2       1258    0       0
2       2246       0       0       2       1870    0       0
2       1799       0       1       2       1709    0       0
2       1674       0       1       2       1568    0       1
2       1527       0       0       2       1324    0       1
2       957        0       1       2       932     0       0
2       847        0       1       2       848     0       1
2       1850       0       0       2       1843    0       0
2       1535       0       0       2       1447    0       0
2       1384       0       0       2       414     2       1
2       2204       2       0       2       1063    2       1
2       481        2       1       2       105     2       1
2       641        2       1       2       390     2       1
2       288        2       1       2       421     1       1
2       79         2       0       2       748     1       1
2       486        1       0       2       48      2       0
2       272        1       0       2       1074    2       1
2       381        1       0       2       10      2       1
2       53         2       0       2       80      2       0
2       35         2       0       2       248     1       1
2       704        2       0       2       211     1       1
2       219        1       1       2       606     1       1
3       2640       0       1       3       2430    0       1
3       2252       0       1       3       2140    0       1
3       2133       0       0       3       1238    0       1
3       1631       0       1       3       2024    0       0
3       1345       0       1       3       1136    0       1
3       845        0       0       3       422     1       0
3       162        2       1       3       84      1       0
3       100        1       1       3       2       2       1
3       47         1       1       3       242     1       1
3       456        1       1       3       268     1       0
3       318        2       0       3       32      1       1
3       467        1       0       3       47      1       1
3       390        1       1       3       183     2       0
3       105        2       1       3       115     1       0
3       164        2       0       3       93      1       0
3       120        1       0       3       80      2       1
3       677        2       1       3       64      1       0
3       168        2       0       3       74      2       0
3       16         2       0       3       157     1       0
3       625        1       0       3       48      1       0
3       273        1       1       3       63      2       1
3       76         1       1       3       113     1       0
3       363        2       1
;
run;


ods select none;
ods output SurvivalPlot=SurvivalPlot;
proc lifetest data=bmt plots=(survival);
time ftime*Status(0);
strata diagnosis;
run;
ods select all;



title;
ods graphics /ATTRPRIORITY=none;
proc sgplot data=SurvivalPlot;
styleattrs DATASYMBOLS=(plus diamond X);
step x=Time y=Survival / group=Stratum lineattrs=(pattern=solid) name='x' ;
scatter x=Time y=Censored / group=Stratum ;
legenditem name='a' type=MARKERLINE / label='ALL' MARKERATTRS=graphdata1(symbol=plus) LINEATTRS=graphdata1;
legenditem name='b' type=MARKERLINE / label='AML high risk' MARKERATTRS=graphdata2(symbol=diamond) LINEATTRS=graphdata2;
legenditem name='c' type=MARKERLINE / label='AML low risk' MARKERATTRS=graphdata3(symbol=X) LINEATTRS=graphdata3;

keylegend 'a' 'b' 'c' / across=1 location=inside position=ne ;
keylegend 'x';
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1761011974186.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110791iC885235057AF9F97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1761011974186.png" alt="Ksharp_0-1761011974186.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/************************************生存曲线 核心语句****************************************/
/*生存曲线  向下   死亡曲线 向上*/

ods select none;
ods output FailurePlot=FailurePlot;
*(atrisk=0 to 960 by 60) 这个也是弄
下面表格 和下面的天数相对应;
proc lifetest data=FAS  plots=survival(failure atrisk=0 to 35 by 5);;
time day*remy(1);
strata treat_char;
run;
ods select all;

/************************************出图 ****************************************/
ods html;
ods listing gpath="&amp;amp;path."  style=htmlblue image_dpi=300;/*这一段是将html的结果存成图片*/
ods graphics /ATTRPRIORITY=none noborder reset=index imagename='failure';/*给图片命名为failure sas默认为png  reset=index为不更改图片的名字*/
proc sgplot data=FailurePlot;
styleattrs DATASYMBOLS=(plus X) DATACONTRASTCOLORS=(blue red );
step x=Time y=_1_SURVIVAL_ / group=Stratum lineattrs=(pattern=solid) name='x' ;
scatter x=Time y=_1_CENSORED_ / group=Stratum ;
legenditem name='a' type=MARKERLINE / label='对照组' MARKERATTRS=(symbol=plus color=blue) LINEATTRS=(color=blue);
legenditem name='b' type=MARKERLINE / label='试验组' MARKERATTRS=(symbol=X color=red) LINEATTRS=(color=red);
*这一行 是用来 弄下面表格的;
xaxistable atrisk / x=tatrisk class=stratum colorgroup=stratum valueattrs=(weight=bold);
xaxis values=(0 to 35 by 5) label='天数';
yaxis values=(0 to 1 by 0.1)  label='改善临床状态概率';
keylegend 'a' 'b'  / across=1 location=inside position=se title='组别' ;
/*keylegend 'x';*/
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1761012045597.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110792i8FFC446125FD1015/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1761012045597.png" alt="Ksharp_1-1761012045597.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 02:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-lifetest-how-to-modify-KM-graph/m-p/977497#M46224</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-10-21T02:01:19Z</dc:date>
    </item>
  </channel>
</rss>

