<?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 Legend Label in PROC LIFETEST Procedure in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245760#M8907</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;,&amp;nbsp;Thank you for the information, I will try the other options as soon as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2016 23:40:12 GMT</pubDate>
    <dc:creator>turcay</dc:creator>
    <dc:date>2016-01-24T23:40:12Z</dc:date>
    <item>
      <title>How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245310#M8891</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m on a project now which is related to pharmaceutical industry. I’m trying to change the legend label of the PROC LIFETEST procedure’s graph result. As you can see the following image, the legend labels seem as &lt;STRONG&gt;Kras=-1 Kras=0 Kras=1&lt;/STRONG&gt; however I need to see the reports as &amp;nbsp;Unknown(Kras=-1), Negative(Kras=0) &amp;nbsp;and Positive(Kras=1). I prepared a sample data set that does not express anything and I’m sharing with you that sample data set as below. How can I see the legend label’s as Unknown , Negative and Positive. Does anybody can lead me, please ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA Have;
Length AVAL 8 KRAS 8;
Infile Datalines Missover;
Input AVAL KRAS ;
Datalines;
80 1
34 1
391 1
221 0
362 0
219 0
113 0
48 1
105 1
18 1
54 1
333 1
172 -1
235 0
81 0
;
Run;

PROC LIFETEST DATA=Have
	ALPHA=0.05
	METHOD=LIFE
	INTERVALS= 30 60 90 120 150 180	PLOTS(ONLY)=SURVIVAL ( STRATA=UNPACK );;
	STRATA KRAS;
	TIME AVAL;
RUN;&lt;/CODE&gt;&lt;/PRE&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;
&lt;P&gt;Thank you.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12225i3CBA8ADF916D3710/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Desired.png" title="Desired.png" /&gt;</description>
      <pubDate>Thu, 21 Jan 2016 21:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245310#M8891</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-21T21:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245313#M8892</link>
      <description>&lt;P&gt;Please tell us the release of SAS you are using and if you are willing to write your own program to create the graph. &amp;nbsp;If yes, do you prefer SGPLOT or GTL?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 21:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245313#M8892</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-01-21T21:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245316#M8893</link>
      <description>&lt;P&gt;Have you tried creating a format and applying a format to the variable in the proc lifetest procedure?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 21:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245316#M8893</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-21T21:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245342#M8894</link>
      <description>&lt;P&gt;As far as I understand there are&amp;nbsp;not any options to change the legend label in&amp;nbsp;PROC LIFETEST.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54﻿&lt;/a&gt;, I'm out office at the moment but I remember the release of SAS as 9.3 . Actually, I'm willing to change the legend label and If is it possible by the help of the GTL or GPLOT, I can write it.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;No, I haven't tried creating a format and&amp;nbsp;applying a format to the variable in the PROC LIFETEST procedure. Could you lead me to reach my aim, please ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 23:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245342#M8894</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-21T23:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245348#M8895</link>
      <description>&lt;P&gt;Your code doesn't seem to match your graph. Is that your actual proc lifetest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Applying a format does change your legend&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create a format that maps your numbers to the text you want. Assume you call it kras_fmt.&lt;/P&gt;
&lt;P&gt;See this paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Change your proc lifetest by adding the following line to your code, again assuming you've called it kras_fmt.&lt;/P&gt;
&lt;P&gt;format kras kras_fmt.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 23:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245348#M8895</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-21T23:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245350#M8896</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, it isn't my actual PROC LIFETEST. I wrote this code to make easier to share with you. I didn't see any paper. Am I missing something ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 23:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245350#M8896</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-21T23:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245351#M8897</link>
      <description>&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/001-30.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi30/001-30.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 23:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245351#M8897</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-21T23:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245353#M8898</link>
      <description>&lt;P&gt;Here's a post with an example of it being used &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The original question includes the proc format and it's used in the graphing procedure, though it's applied through proc datasets first. That isn't necessary, it can be applied directly in the statistical&amp;nbsp;procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/How-To-Show-Variables-Legendlabel-and-Median-amp-Mean-Value-on/m-p/237333/highlight/true#M8612" target="_blank"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/How-To-Show-Variables-Legendlabel-and-Median-amp-Mean-Value-on/m-p/237333/highlight/true#M8612&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 23:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245353#M8898</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-21T23:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245354#M8899</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;, The following code is working . After you adviced me the Proc Format I was trying to find my Box-Whisker . How can you find it ? But I want to ask one more question, apart from Proc Format&lt;STRONG&gt; is there any method to create my desired output&lt;/STRONG&gt; ? Let me check on customer place . If it works there then I'll close this discussion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&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;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
value Kras_fmt
-1='Negative'
0='Unknown'
1='Positive'
;
run;
PROC LIFETEST DATA=Have
     ALPHA=0.05
     METHOD=LIFE
     INTERVALS= 30 60 90 120 150 180 PLOTS(ONLY)=SURVIVAL ( STRATA=UNPACK );
    Format Kras Kras_fmt.;
     STRATA KRAS;
     TIME AVAL;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2016 00:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245354#M8899</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-22T00:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245360#M8900</link>
      <description>&lt;P&gt;Other options:&lt;/P&gt;
&lt;P&gt;1. Recode variable into a character variable directly&lt;/P&gt;
&lt;P&gt;2. Extract Data from proc lifetest and use a graphic procedure&lt;/P&gt;
&lt;P&gt;3. Look at macro suggestions from SAS in documentation to modify survival curves.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did I find your post? Search term: PROC FORMAT Limit by User on left hand menu to Turcay.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2016 00:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245360#M8900</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-22T00:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Legend Label in PROC LIFETEST Procedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245760#M8907</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;,&amp;nbsp;Thank you for the information, I will try the other options as soon as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 23:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-Change-Legend-Label-in-PROC-LIFETEST-Procedure/m-p/245760#M8907</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-24T23:40:12Z</dc:date>
    </item>
  </channel>
</rss>

