<?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: Help with proc format for %newsurv macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/618338#M181395</link>
    <description>&lt;P&gt;The ordering is based on the formatted levels (i.e. alphabetic is what's shown as 1=AP, 2=APCP, 3=CP, 4=Controls).&lt;/P&gt;
&lt;P&gt;You can either adjust your format as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value grpLabel 1='01Controls' 2='02AP' 3='03CP' 4='04APCP';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I guarantee you don't want this because of the appearance on the graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, change your &lt;STRONG&gt;%new_surv&lt;/STRONG&gt; call as the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%newsurv(DATA=three, TIME=dur, CENS=PDAC, CEN_VL=0, SUMMARY=0, CLASS=Group, 
	CLASSREF=Controls, CLASSORDER=4 1 3 2, COLOR=black red green blue, 
	PATTERN=solid, LINESIZE=3pt, SYMBOLSIZE=10pt, METHOD=CIF, EV_VL=1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the 4 1 3 2 matches the label order that you want (as above 4=Controls, 1=AP, 3=CP 2=APCP).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
    <pubDate>Sun, 19 Jan 2020 04:53:19 GMT</pubDate>
    <dc:creator>unison</dc:creator>
    <dc:date>2020-01-19T04:53:19Z</dc:date>
    <item>
      <title>Help with proc format for %newsurv macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/616982#M180725</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I wanted to get the grouping variable in order on the figures generated for the CIF curves using the %newsurv macro. I want the controls on top row, then AP CP and APCP. However, when I use CLASSORDER 1 2 3 4, the display on the curve is still going by alphabetical order and not by the order on the macro. For both the legend on the top left and for the Patients-at-risk at the bottom, I want Controls on the top row followed by AP, CP and APCP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed that the CLASSREF goes by the formatted value Controls and not by 1 and the CLASSORDER goes by 1 2 3 4 and not by Controls AP CP APCP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would really appreciate any help with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the macro and the template examples from the link below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Kaplan-Meier-Survival-Plotting-Macro-NEWSURV/ta-p/479747" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Kaplan-Meier-Survival-Plotting-Macro-NEWSURV/ta-p/479747&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2_Color_New.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35305iFC72B8D8060D1459/image-size/large?v=v2&amp;amp;px=999" role="button" title="2_Color_New.png" alt="2_Color_New.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value grpLabel 1='Controls' 2='AP' 3='CP' 4='APCP';
run;
 
data three;
Set Two;
        format Group grpLabel.;
if SmokEFS = 0 then Group = 1;
else if SmokEFS = 1 then Group = 2;
else if SmokEFS = 2 then Group = 3;
else if SmokEFS = 3 then Group = 4;
run;

 %newsurv(DATA=three, TIME=dur, CENS=PDAC, CEN_VL=0, SUMMARY=0, CLASS=Group, CLASSREF=Controls, CLASSORDER=1 2 3 4,
    COLOR=black red green blue, PATTERN=solid, LINESIZE=3pt, SYMBOLSIZE=10pt,
     METHOD=CIF, EV_VL=1);&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 17:23:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/616982#M180725</guid>
      <dc:creator>sms1891</dc:creator>
      <dc:date>2020-01-13T17:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with proc format for %newsurv macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/618338#M181395</link>
      <description>&lt;P&gt;The ordering is based on the formatted levels (i.e. alphabetic is what's shown as 1=AP, 2=APCP, 3=CP, 4=Controls).&lt;/P&gt;
&lt;P&gt;You can either adjust your format as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value grpLabel 1='01Controls' 2='02AP' 3='03CP' 4='04APCP';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I guarantee you don't want this because of the appearance on the graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, change your &lt;STRONG&gt;%new_surv&lt;/STRONG&gt; call as the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%newsurv(DATA=three, TIME=dur, CENS=PDAC, CEN_VL=0, SUMMARY=0, CLASS=Group, 
	CLASSREF=Controls, CLASSORDER=4 1 3 2, COLOR=black red green blue, 
	PATTERN=solid, LINESIZE=3pt, SYMBOLSIZE=10pt, METHOD=CIF, EV_VL=1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the 4 1 3 2 matches the label order that you want (as above 4=Controls, 1=AP, 3=CP 2=APCP).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 04:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/618338#M181395</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-01-19T04:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with proc format for %newsurv macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/618880#M181611</link>
      <description>&lt;P&gt;Thanks for the response to my question. I had figured it out and it is on the macro description of the original macro code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CLASSORDER = List of numbers corresponding to the preferred order of the&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alphabetically sorted class variable formatted values.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example: Values = A, B, C. &amp;nbsp;CLASSORDER = 2 1 3 would cause&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;order to be B, A, C.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 15:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-proc-format-for-newsurv-macro/m-p/618880#M181611</guid>
      <dc:creator>sms1891</dc:creator>
      <dc:date>2020-01-21T15:35:22Z</dc:date>
    </item>
  </channel>
</rss>

