<?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: Kaplan-Meier Curve: How to show number censored below plot? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/921384#M45787</link>
    <description>&lt;P&gt;Every customization, of which I was aware that customers wanted before I retired, is illustrated in this chapter.&amp;nbsp;&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>Thu, 21 Mar 2024 19:42:24 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2024-03-21T19:42:24Z</dc:date>
    <item>
      <title>Kaplan-Meier Curve: How to show number censored below plot?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/474772#M24711</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a way to tailor my Kaplan-Meier plots to present the data I need to show, including number of subjects at risk. The only issue is that now I need to add the number censored in brackets next to the number at risk at each time point (every 500 days). I don't know how to modify the code to do this. The only option I have at the moment is the calculate the number censored by hand and add it in at the bottom using powerpoint, which is less than optimal due to formatting issues and potential for human error. Any help would be greatly appreciated. My code is below. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; _null_&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;%let&lt;/SPAN&gt; url = //support.sas.com/documentation/onlinedoc/stat/ex_code/142;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;infile&lt;/SPAN&gt; "http:&amp;amp;url/templft.html"&lt;SPAN class="s2"&gt; device=url;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;file&lt;/SPAN&gt; 'macros.tmp'&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;retain&lt;/SPAN&gt; pre &lt;SPAN class="s4"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;input&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_infile_ = tranwrd(_infile_, &lt;SPAN class="s5"&gt;'&amp;amp;amp;'&lt;/SPAN&gt;, &lt;SPAN class="s5"&gt;'&amp;amp;'&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_infile_ = tranwrd(_infile_, &lt;SPAN class="s5"&gt;'&amp;amp;lt;'&lt;/SPAN&gt; , &lt;SPAN class="s5"&gt;'&amp;lt;'&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;if&lt;/SPAN&gt; index(_infile_, &lt;SPAN class="s5"&gt;'&amp;lt;/pre&amp;gt;'&lt;/SPAN&gt;) &lt;SPAN class="s3"&gt;then&lt;/SPAN&gt; pre = &lt;SPAN class="s4"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;if&lt;SPAN class="s2"&gt; pre &lt;/SPAN&gt;then put _infile_&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;if&lt;/SPAN&gt; index(_infile_, &lt;SPAN class="s5"&gt;'&amp;lt;pre&amp;gt;'&lt;/SPAN&gt;)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;then&lt;/SPAN&gt; pre = &lt;SPAN class="s4"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p5"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;%inc&lt;/SPAN&gt; &lt;SPAN class="s5"&gt;'macros.tmp'&lt;/SPAN&gt; / nosource;&lt;/P&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p6"&gt;* Modify the template;&lt;/P&gt;&lt;P class="p2"&gt;%&lt;STRONG&gt;&lt;I&gt;ProvideSurvivalMacros&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;%let&lt;/SPAN&gt; TitleText0 = "Kaplan-Meier Plot: Probability of death, stratified by CD4 count at time of HIV diagnosis";&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;%let&lt;/SPAN&gt; yOptions = label="Survival Probability"&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;linearopts=(viewmin=0.7 viewmax=1 tickvaluelist=(0.7 0.8 0.9 1.0));&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;%let&lt;/SPAN&gt; xOptions = label="Time (days since release)" ;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;%let&lt;/SPAN&gt; GraphOpts = DataContrastColors=(green red blue)&lt;/P&gt;&lt;P class="p2"&gt;DataColors=(green red blue);&lt;/P&gt;&lt;P class="p6"&gt;/*%let TitleText1 = &amp;amp;titletext0 "CD4 count at diagnosis " STRATUMID;*/&lt;/P&gt;&lt;P class="p2"&gt;%&lt;STRONG&gt;&lt;I&gt;CompileSurvivalTemplates&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p6"&gt;*KM stratified by AIDS STAGE**************************************************************;&lt;/P&gt;&lt;P class="p5"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;format&lt;/STRONG&gt;&lt;SPAN class="s2"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s3"&gt;invalue&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; CD4_atdiagnosiscat &lt;/SPAN&gt;'&amp;gt;=500 cells/µL'&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; '200-499 cells/µL'&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt; '&amp;lt;200 cells/µL'&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s3"&gt;value&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; CD4_atdiagnosisfmt &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;'&amp;gt;=500 cells/µL' &lt;SPAN class="s4"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;'200-499 cells/µL' &lt;SPAN class="s4"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = &lt;/SPAN&gt;'&amp;lt;200 cells/µL'&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p5"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; tempCD4(&lt;SPAN class="s3"&gt;drop&lt;/SPAN&gt;=g);&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;set&lt;/SPAN&gt; CLEAN.databasesurv3(&lt;SPAN class="s3"&gt;rename&lt;/SPAN&gt;=(CD4_atdiagnosis=g));&lt;/P&gt;&lt;P class="p2"&gt;CD4_atdiagnosis = input(g, &lt;SPAN class="s4"&gt;CD4_atdiagnosiscat.&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p5"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p6"&gt;* Analysis;&lt;/P&gt;&lt;P class="p1"&gt;ods graphics on&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;&lt;STRONG&gt;lifetest&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;data&lt;/SPAN&gt;=work.tempCD4 &lt;SPAN class="s3"&gt;method&lt;/SPAN&gt;=km &lt;SPAN class="s3"&gt;atrisk&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p6"&gt;&lt;SPAN class="s2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;plots&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;=(S(&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;test&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;nocensor&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;atrisk&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;maxlen&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;16&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;outside&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;0.12&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;))=&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; to &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;3000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; by &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;500&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;)&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;time&lt;/SPAN&gt; time*EVENT_ANYDEATH(&lt;SPAN class="s4"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;strata&lt;/SPAN&gt; CD4_atdiagnosis / order=internal &lt;SPAN class="s3"&gt;adjust&lt;/SPAN&gt;=sidak &lt;SPAN class="s3"&gt;test&lt;/SPAN&gt;=logrank ;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s3"&gt;label&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; CD4_atdiagnosis = &lt;/SPAN&gt;"CD4 count at diagnosis"&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;format&lt;/SPAN&gt; CD4_atdiagnosis &lt;SPAN class="s4"&gt;CD4_atdiagnosisfmt.&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p5"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;ods graphics off&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jul 2018 15:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/474772#M24711</guid>
      <dc:creator>Kels123</dc:creator>
      <dc:date>2018-07-01T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Kaplan-Meier Curve: How to show number censored below plot?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/483532#M25110</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This example is from one of my tutorials.&amp;nbsp; The point is you can construct a macro that adds DRAW statements to enhance the graph in any way.&amp;nbsp; If you need to make the contents depend on data, you can do that too.&amp;nbsp; You could use CALL EXECUTE to write the statements.&amp;nbsp; While this paper does not do what you ask, it shows the incredible lengths you can go to to customize graphs.&amp;nbsp;&amp;nbsp;&lt;A href="https://www.pharmasug.org/proceedings/2018/DV/PharmaSUG-2018-DV03.pdf&amp;nbsp;" target="_blank"&gt;https://www.pharmasug.org/proceedings/2018/DV/PharmaSUG-2018-DV03.pdf&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%ProvideSurvivalMacros

%macro StmtsBeginGraph; 
  * Coordinates are ad hoc, and there are many 
     available coordinate systems.
     See the documentation for more information.;
  drawtext textattrs=(weight=Bold) 'Number at Risk' / 
                  x=5 y=14 width=9;
%mend;

%CompileSurvivalTemplates

proc lifetest data=sashelp.BMT 
                      plots=survival(atrisk outside maxlen=13);
   time T * Status(0);
   strata Group;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 19:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/483532#M25110</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2018-08-02T19:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Kaplan-Meier Curve: How to show number censored below plot?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/921375#M45785</link>
      <description>&lt;P&gt;I have the same question. I want show #in-risk(#censored) at each time interval below KM plot. #censored is #patients who did not have event but lost follow up prior the time point (Censored at last contact), they are hash markers in survival curve.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&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;</description>
      <pubDate>Thu, 21 Mar 2024 19:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/921375#M45785</guid>
      <dc:creator>lih</dc:creator>
      <dc:date>2024-03-21T19:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kaplan-Meier Curve: How to show number censored below plot?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/921384#M45787</link>
      <description>&lt;P&gt;Every customization, of which I was aware that customers wanted before I retired, is illustrated in this chapter.&amp;nbsp;&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>Thu, 21 Mar 2024 19:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Kaplan-Meier-Curve-How-to-show-number-censored-below-plot/m-p/921384#M45787</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2024-03-21T19:42:24Z</dc:date>
    </item>
  </channel>
</rss>

