<?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 Re: How to change the starting time point of Kaplan plot - Proc lifetest? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851927#M42169</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
I think there is NOT any simple plain statement to get this
*/
ods select none ;
ods output  SurvivalPlot= SurvivalPlot ;
proc lifetest data=sashelp.bmt  plots=survival(cl atrisk=(0 to 2500 by 500) ) ; 
time T*Status(0);
Strata Group;
run;
ods select all ;

data SurvivalPlot1;
 merge SurvivalPlot SurvivalPlot(keep=StratumNum Time 
 rename=(StratumNum=_StratumNum Time=_Time) firstobs=2);
output;
if StratumNum=_StratumNum  then do;
 do Time=Time+1 to _Time-1;
  call missing(Censored,AtRisk,tAtRisk);output;
 end;
end;
drop _StratumNum _Time;
run;
data SurvivalPlot2;
 set SurvivalPlot1;
 by StratumNum;
 retain new_SDF_UCL new_SDF_LCL new_Survival;
 if first.StratumNum then call missing(new_SDF_UCL,new_SDF_LCL,new_Survival);
 if not missing(SDF_UCL) then  new_SDF_UCL=SDF_UCL;
 if not missing(SDF_LCL) then  new_SDF_LCL=SDF_LCL;
 if not missing(Survival) then  new_Survival=Survival;
 Stratum=scan(Stratum,-1,':');
run;
proc sgplot data=SurvivalPlot2;
where Time&amp;gt;=500 ;   /* &amp;lt;------- Here is */
band x=Time lower=new_SDF_LCL  upper=new_SDF_UCL /group=Stratum transparency=0.8 ;
step x=Time y=new_Survival /group=Stratum name='a';
scatter x=Time y=Censored/group=Stratum markerattrs=(symbol=plus);
xaxistable AtRisk/ x=tAtRisk class=Stratum colorgroup=Stratum location=inside  
                   TITLEATTRS=(size=8 weight=bold) VALUEATTRS=(size=8 weight=bold);
inset '+ Censored' /position=ne border;
keylegend 'a'/title='Disease Group';
yaxis values=(0 to 1 by 0.2);
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_0-1672745948848.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79003i0B594D090033A96B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1672745948848.png" alt="Ksharp_0-1672745948848.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;If you remove "where Time&amp;gt;=500 ; " ,you could get this :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1672745981489.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79004i5E54E7BD9CE8DCF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1672745981489.png" alt="Ksharp_1-1672745981489.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2023 11:40:08 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-01-03T11:40:08Z</dc:date>
    <item>
      <title>How to change the starting time point of Kaplan plot - Proc lifetest?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851869#M42163</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am a layman SAS user. Can anyone please tell me how I change the starting point of a Kaplan graph? For example, I want to start directly from 10 months onward.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stage.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78986iFA53CBCB240FF2CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Stage.png" alt="Stage.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Like in this graph I only need 10 months onward to 60. How do I exclude a timeline from 0 to 10?&lt;BR /&gt;&lt;BR /&gt;I am using this statement [proc lifetest data=WORK.CS notable plots=survival (atrisk(maxlen=13)=0 to 60 by 12) MAXTIME=60;&lt;BR /&gt;time 'Survival months'n*'Vital status'n(1);&lt;BR /&gt;Strata Gender;&lt;BR /&gt;run;}&lt;BR /&gt;&lt;BR /&gt;Is there any simple plain statement like MAXIME limiting the ending point?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 21:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851869#M42163</guid>
      <dc:creator>Medidata</dc:creator>
      <dc:date>2023-01-02T21:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the starting time point of Kaplan plot - Proc lifetest?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851870#M42164</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure whether it's possible in a very easy way (like using a simple option in PROC LIFETEST).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, you can definitely change the (outlook of the) plot the way you want the "hard" way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;SAS/STAT® 15.1 User’s Guide&lt;BR /&gt;Customizing the Kaplan-Meier Survival Plot&lt;BR /&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;/LI&gt;
&lt;LI&gt;Paper 427-2013&lt;BR /&gt;Creating and Customizing the Kaplan-Meier Survival Plot in PROC LIFETEST&lt;BR /&gt;Warren F. Kuhfeld and Ying So, SAS Institute Inc.&lt;BR /&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings13/427-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/427-2013.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Paper SP14–SAS-2014&lt;BR /&gt;Creating and Customizing the Kaplan-Meier Survival Plot in PROC LIFETEST in the SAS/STAT® 13.1 Release&lt;BR /&gt;Warren F. Kuhfeld and Ying So, SAS Institute Inc.&lt;BR /&gt;&lt;A href="https://www.lexjansen.com/pharmasug/2014/SP/PharmaSUG-2014-SP14-SAS.pdf" target="_blank"&gt;https://www.lexjansen.com/pharmasug/2014/SP/PharmaSUG-2014-SP14-SAS.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Creating and customizing the Kaplan-Meier Survival Plot in PROC LIFETEST&lt;BR /&gt;&lt;A href="https://video.sas.com/detail/video/2918155168001/creating-and-customizing-the-kaplan-meier-survival-plot-in-proc-lifetest" target="_blank"&gt;https://video.sas.com/detail/video/2918155168001/creating-and-customizing-the-kaplan-meier-survival-plot-in-proc-lifetest&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;MWSUG 2014 - Paper AA08&lt;BR /&gt;Kaplan-Meier Survival Plotting Macro %NEWSURV&lt;BR /&gt;Jeffrey Meyers, Mayo Clinic, Rochester, Minnesota&lt;BR /&gt;&lt;A href="https://www.mwsug.org/proceedings/2014/AA/MWSUG-2014-AA08.pdf" target="_blank"&gt;https://www.mwsug.org/proceedings/2014/AA/MWSUG-2014-AA08.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 21:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851870#M42164</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-02T21:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the starting time point of Kaplan plot - Proc lifetest?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851927#M42169</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
I think there is NOT any simple plain statement to get this
*/
ods select none ;
ods output  SurvivalPlot= SurvivalPlot ;
proc lifetest data=sashelp.bmt  plots=survival(cl atrisk=(0 to 2500 by 500) ) ; 
time T*Status(0);
Strata Group;
run;
ods select all ;

data SurvivalPlot1;
 merge SurvivalPlot SurvivalPlot(keep=StratumNum Time 
 rename=(StratumNum=_StratumNum Time=_Time) firstobs=2);
output;
if StratumNum=_StratumNum  then do;
 do Time=Time+1 to _Time-1;
  call missing(Censored,AtRisk,tAtRisk);output;
 end;
end;
drop _StratumNum _Time;
run;
data SurvivalPlot2;
 set SurvivalPlot1;
 by StratumNum;
 retain new_SDF_UCL new_SDF_LCL new_Survival;
 if first.StratumNum then call missing(new_SDF_UCL,new_SDF_LCL,new_Survival);
 if not missing(SDF_UCL) then  new_SDF_UCL=SDF_UCL;
 if not missing(SDF_LCL) then  new_SDF_LCL=SDF_LCL;
 if not missing(Survival) then  new_Survival=Survival;
 Stratum=scan(Stratum,-1,':');
run;
proc sgplot data=SurvivalPlot2;
where Time&amp;gt;=500 ;   /* &amp;lt;------- Here is */
band x=Time lower=new_SDF_LCL  upper=new_SDF_UCL /group=Stratum transparency=0.8 ;
step x=Time y=new_Survival /group=Stratum name='a';
scatter x=Time y=Censored/group=Stratum markerattrs=(symbol=plus);
xaxistable AtRisk/ x=tAtRisk class=Stratum colorgroup=Stratum location=inside  
                   TITLEATTRS=(size=8 weight=bold) VALUEATTRS=(size=8 weight=bold);
inset '+ Censored' /position=ne border;
keylegend 'a'/title='Disease Group';
yaxis values=(0 to 1 by 0.2);
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_0-1672745948848.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79003i0B594D090033A96B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1672745948848.png" alt="Ksharp_0-1672745948848.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;If you remove "where Time&amp;gt;=500 ; " ,you could get this :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1672745981489.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79004i5E54E7BD9CE8DCF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1672745981489.png" alt="Ksharp_1-1672745981489.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 11:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/851927#M42169</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-03T11:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the starting time point of Kaplan plot - Proc lifetest?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/852475#M42183</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
Here could get more simple code,
I missed an important option TYPE=STEP
*/
ods select none ;
ods output  SurvivalPlot= SurvivalPlot ;
proc lifetest data=sashelp.bmt  plots=survival(cl atrisk=(0 to 2500 by 500) ) ; 
time T*Status(0);
Strata Group;
run;
ods select all ;



proc sgplot data=SurvivalPlot;
where Time&amp;gt;=500 ;   /* &amp;lt;------- Here is */
band x=Time lower=SDF_LCL  upper=SDF_UCL /group=Stratum transparency=0.8 type=step;
step x=Time y=Survival /group=Stratum name='a';
scatter x=Time y=Censored/group=Stratum markerattrs=(symbol=plus);
xaxistable AtRisk/ x=tAtRisk class=Stratum colorgroup=Stratum location=inside  
                   TITLEATTRS=(size=8 weight=bold) VALUEATTRS=(size=8 weight=bold);
inset '+ Censored' /position=ne border;
keylegend 'a'/title='Disease Group';
yaxis values=(0 to 1 by 0.2);
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_0-1673005636061.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79098i911D6A3C7EB24A4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1673005636061.png" alt="Ksharp_0-1673005636061.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 11:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/852475#M42183</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-06T11:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the starting time point of Kaplan plot - Proc lifetest?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/853340#M42229</link>
      <description>Thank you, It's worked....</description>
      <pubDate>Wed, 11 Jan 2023 20:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-starting-time-point-of-Kaplan-plot-Proc/m-p/853340#M42229</guid>
      <dc:creator>Medidata</dc:creator>
      <dc:date>2023-01-11T20:05:33Z</dc:date>
    </item>
  </channel>
</rss>

