<?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 reference group in PROC LIFEREG? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276125#M14574</link>
    <description>&lt;P&gt;OK... Thanks for your help. Really appreciate it.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2016 21:40:03 GMT</pubDate>
    <dc:creator>tmleung</dc:creator>
    <dc:date>2016-06-08T21:40:03Z</dc:date>
    <item>
      <title>How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276107#M14565</link>
      <description>&lt;P&gt;Hi, I am learning SAS. I am running a survival analysis using PROC LIFEREG. The categorical varialbe has 4 groups, namely 1-4. The default reference group is the last group. How can I change it to be the first group?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc lifereg data=larynx;&lt;BR /&gt;class stage;&lt;BR /&gt;model deathtime*death(0)=stage / distribution=exponential;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 20:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276107#M14565</guid>
      <dc:creator>tmleung</dc:creator>
      <dc:date>2016-06-08T20:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276113#M14566</link>
      <description>&lt;P&gt;Try the&amp;nbsp;&lt;U&gt;ORDER&amp;nbsp;&lt;/U&gt; option in the PROC LIFEREG statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276113#M14566</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-08T21:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276118#M14570</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc lifereg data=larynx;&lt;BR /&gt;class stage/ order=data;&lt;BR /&gt;model deathtime*death(0)=stage / distribution=exponential;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried just&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;class stage/ order;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but still didnt work. and this is what i got&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;12 class stage/ order=data;&lt;BR /&gt;-----&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;NOTE: PROCEDURE LIFEREG used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, TRUNCATE.&lt;BR /&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276118#M14570</guid>
      <dc:creator>tmleung</dc:creator>
      <dc:date>2016-06-08T21:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276119#M14571</link>
      <description>&lt;P&gt;Re-read what I posted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Order on proc lifereg statement, not class statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276119#M14571</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-08T21:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276122#M14572</link>
      <description>&lt;P&gt;I see....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc lifereg data=larynx order=data;&lt;BR /&gt;class stage;&lt;BR /&gt;model deathtime*death(0)=stage / distribution=exponential;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it still uses stage 4 as my reference group, not stage 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276122#M14572</guid>
      <dc:creator>tmleung</dc:creator>
      <dc:date>2016-06-08T21:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276123#M14573</link>
      <description>&lt;P&gt;Then unfortunately you'll have to recode the variables in such a way that the last group will be your reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Procs have options to change this, but it appears proc LIFEREG doesn't &lt;span class="lia-unicode-emoji" title=":tired_face:"&gt;😫&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276123#M14573</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-08T21:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276125#M14574</link>
      <description>&lt;P&gt;OK... Thanks for your help. Really appreciate it.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276125#M14574</guid>
      <dc:creator>tmleung</dc:creator>
      <dc:date>2016-06-08T21:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276145#M14577</link>
      <description>class stage(ref='xxx');</description>
      <pubDate>Thu, 09 Jun 2016 03:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276145#M14577</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-09T03:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276147#M14578</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;Unfortunately PROC LIFEREG does not support the REF= option. The only valid option is TRUNCATE, according to the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_lifereg_syntax04.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_lifereg_syntax04.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 03:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276147#M14578</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-09T03:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276149#M14579</link>
      <description>&lt;PRE&gt;
Well. That is bad new. But if it is character, Padding some blank before it to make it happen.

e.x.
want have F be the last level.

if sex='M' then sex='  M';

&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jun 2016 04:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276149#M14579</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-09T04:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276188#M14582</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89263"&gt;@tmleung﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've just tested it and found that the ORDER= option of the PROC LIFEREG statement (as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;) with possible values&amp;nbsp;DATA, FORMATTED (the default), FREQ or INTERNAL works very well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If ORDER=DATA leaves stage 4 as the reference group, this means that in your input dataset LARYNX stage 4 happens to occur last in the order of observations. So, you have two options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Either you sort dataset LARYNX e.g. by descending STAGE (assuming that this variable has values 1, 2, 3, 4) and then use ORDER=DATA.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=larynx;
by descending stage;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Or you define a format for variable STAGE such that the label of stage 1 comes last in alphabetical order and apply that format to variable STAGE in the PROC LIFEREG step (or assign it permanently in LARYNX), where you also specify ORDER=FORMATTED. Example:&lt;BR /&gt;
&lt;PRE&gt;proc format;&lt;BR /&gt;value stagef&lt;BR /&gt;1='Stage 1';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc lifereg data=larynx order=formatted;&lt;BR /&gt;format stage stagef.;&lt;BR /&gt;class stage;&lt;BR /&gt;model deathtime*death(0)=stage / distribution=exponential;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;These tips can also be found in &lt;A href="http://support.sas.com/kb/37/108.html" target="_blank"&gt;http://support.sas.com/kb/37/108.html&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 08:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276188#M14582</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-06-09T08:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276252#M14596</link>
      <description>&lt;P&gt;Thanks. &amp;nbsp;I have tried to re-order by using PROC SORT but it still takes stage 4 as the reference group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try the PROC FORMAT method later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 13:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276252#M14596</guid>
      <dc:creator>tmleung</dc:creator>
      <dc:date>2016-06-09T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276301#M14597</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89263"&gt;@tmleung&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;... &amp;nbsp;I have tried to re-order by using PROC SORT but it still takes stage 4 as the reference group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is odd, because in an earlier post you wrote that it also used stage 4 as the reference group with ORDER=DATA, &lt;EM&gt;before&lt;/EM&gt; re-sorting. Sounds like you or your computer made a mistake. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To investigate this, you can use the same ORDER= options with PROC FREQ. The last category in PROC FREQ output should normally be the reference category used by the corresponding PROC LIFEREG step.&amp;nbsp;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=larynx order=data;
tables stage;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jun 2016 15:51:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276301#M14597</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-06-09T15:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the reference group in PROC LIFEREG?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276304#M14598</link>
      <description>&lt;P&gt;You are right. I tried with SAS in another computer and ORDER=DATA works... weird...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 16:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-change-the-reference-group-in-PROC-LIFEREG/m-p/276304#M14598</guid>
      <dc:creator>tmleung</dc:creator>
      <dc:date>2016-06-09T16:00:31Z</dc:date>
    </item>
  </channel>
</rss>

