<?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: Modifications to Kaplan-Meier Curve for printing: y-axis and number at risk in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397072#M20704</link>
    <description>&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/142/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/142/kaplan.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you looked at this chapter? &amp;nbsp;I think it provides clear explanations of what you want. &amp;nbsp;I wrote it so I&amp;nbsp;would really like to know what parts aren't clear. You can contact me with questions, I am saswfk I am at sas and you know the rest. &amp;nbsp;The macros are much clearer than going in and modifying full templates and the examples address your questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2017 11:15:16 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2017-09-19T11:15:16Z</dc:date>
    <item>
      <title>Modifications to Kaplan-Meier Curve for printing: y-axis and number at risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397053#M20703</link>
      <description>&lt;P&gt;I have a curve I am printing using proc lifetest:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&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="s2"&gt;data&lt;/SPAN&gt;=CLEAN.databasesurv3 &lt;SPAN class="s2"&gt;plots&lt;/SPAN&gt;=s &lt;SPAN class="s2"&gt;outsurv&lt;/SPAN&gt;=clean.SurvEst_AIDSSTAGE &lt;SPAN class="s2"&gt;conftype&lt;/SPAN&gt;=linear;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;time&lt;/SPAN&gt; time * EVENT_ANYDEATH(&lt;SPAN class="s3"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;strata&lt;/SPAN&gt; disease_categ_dx2_num ;&lt;/P&gt;&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;The problem is I need to do a few key modifications&amp;nbsp;things:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;1.) Modify the y-axis to start at 0.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;2.) Add number of individuals at risk (for each stratum if possible)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;3.) Add the log-rank p-value in a legend (not as dire as the other two things)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;I have tried modifying the proc lifetest code, and also using proc gplot, proc template, and macros like %newsurv, but nothing has gotten close to what I need and I think now I am just thoroughly confused. I know this is a common problem, and I could really use a solution that doesn't require an in-depth&amp;nbsp;expertise in programming. It seems like I should use "layout overlay", but that seems to be part of proc template, which is very intimidating at this point. This is the closest I have gotten so far, using this code:&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&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="s2"&gt;data&lt;/SPAN&gt;=CLEAN.databasesurv3 &lt;SPAN class="s2"&gt;method&lt;/SPAN&gt;=km &lt;SPAN class="s2"&gt;atrisk&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s3"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;plots&lt;SPAN class="s3"&gt;=(S(&lt;/SPAN&gt;test nocensor atrisk&lt;SPAN class="s3"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; to &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;3000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; by &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;500&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;)) &lt;/SPAN&gt;method&lt;SPAN class="s3"&gt;=km &lt;/SPAN&gt;MAXTIME&lt;SPAN class="s3"&gt;= &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;3000&lt;/STRONG&gt;&lt;/SPAN&gt; intervals&lt;SPAN class="s3"&gt;=(&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; to &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;3000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; by &lt;/SPAN&gt;&lt;SPAN class="s4"&gt;&lt;STRONG&gt;500&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&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="p1"&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;&lt;SPAN class="s2"&gt;strata&lt;/SPAN&gt; disease_categ_dx2_num / &lt;SPAN class="s2"&gt;adjust&lt;/SPAN&gt;=sidak &lt;SPAN class="s2"&gt;test&lt;/SPAN&gt;=logrank;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s3"&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;&lt;/SPAN&gt;/*format chemo_weeks_cat chemo_weeks_cat.;*/&lt;/P&gt;&lt;P class="p4"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s3"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p4"&gt;&lt;SPAN class="s3"&gt;I was thinking maybe I could combine it with something like this? Thank you in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;%&lt;STRONG&gt;&lt;I&gt;ProvideSurvivalMacros&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;%let&lt;/SPAN&gt; yOptions = label="Survival Probability"&lt;/P&gt;&lt;P class="p1"&gt;linearopts=(viewmin=0.6 viewmax=1&lt;/P&gt;&lt;P class="p2"&gt;/*tickvaluelist=(0 .2 .4 .6 .8 1.0))*/&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;%&lt;STRONG&gt;&lt;I&gt;CompileSurvivalTemplates&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Any assistance would be greatly appreciated. If I DO need to use proc template or a macro, it would be really helpful to have a better explanation of how these work together with proc lifetest than the explanations I have found previously online.&amp;nbsp;Thank you in advance.&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 09:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397053#M20703</guid>
      <dc:creator>Kels123</dc:creator>
      <dc:date>2017-09-19T09:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to Kaplan-Meier Curve for printing: y-axis and number at risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397072#M20704</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/142/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/142/kaplan.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you looked at this chapter? &amp;nbsp;I think it provides clear explanations of what you want. &amp;nbsp;I wrote it so I&amp;nbsp;would really like to know what parts aren't clear. You can contact me with questions, I am saswfk I am at sas and you know the rest. &amp;nbsp;The macros are much clearer than going in and modifying full templates and the examples address your questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 11:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397072#M20704</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-09-19T11:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Modifications to Kaplan-Meier Curve for printing: y-axis and number at risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397104#M20705</link>
      <description>&lt;P&gt;It looks to me like you had it figured out. &amp;nbsp;This code works for me. &amp;nbsp;What else do you need?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
* One time set up to get the macros;
data _null_;
   %let url = //support.sas.com/documentation/onlinedoc/stat/ex_code/142;
   infile "http:&amp;amp;url/templft.html" device=url;

   file 'macros.tmp';
   retain pre 0;
   input;
   _infile_ = tranwrd(_infile_, '&amp;amp;amp;', '&amp;amp;');
   _infile_ = tranwrd(_infile_, '&amp;amp;lt;' , '&amp;lt;');
   if index(_infile_, '&amp;lt;/pre&amp;gt;') then pre = 0;
   if pre then put _infile_;
   if index(_infile_, '&amp;lt;pre&amp;gt;')  then pre = 1;
run;

%inc 'macros.tmp' / nosource;


* Modify the template;
%ProvideSurvivalMacros
%let yOptions = label="Survival Probability"
                linearopts=(viewmin=0.5 viewmax=1);
%CompileSurvivalTemplates

* Analysis;
ods graphics on;
proc lifetest data=sashelp.bmt method=km atrisk
     plots=(S(test nocensor atrisk=0 to 3000 by 500)) 
            method=km MAXTIME= 3000 intervals=(0 to 3000 by 500);
    time t*status(0);
    strata group / adjust=sidak test=logrank;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Sep 2017 13:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Modifications-to-Kaplan-Meier-Curve-for-printing-y-axis-and/m-p/397104#M20705</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-09-19T13:18:49Z</dc:date>
    </item>
  </channel>
</rss>

