<?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 How to change colour and line style of proc liftest (kaplan graph)? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849456#M37119</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am a non-professional SAS user, a medical student, so I have no idea about macros, etc. Can anyone just tell me in very simple terms how do I change the colour and style of lines in a kaplan graph (Proc lifetest)? I followed the guideline of SAS user guide and pasted this code&lt;BR /&gt;[%ProvideSurvivalMacros&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let GraphOpts = DataContrastColors=(green red blue)&lt;BR /&gt;DataColors=(green red blue);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%CompileSurvivalTemplates&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc lifetest data=WORK.IMPORT;&lt;BR /&gt;time 'Survival months1'n*'Survival months'n(1);&lt;BR /&gt;strata Stage;&lt;BR /&gt;run;]&lt;BR /&gt;&lt;BR /&gt;But I am now getting this error.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS error.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78459iB042DEB035217144/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS error.JPG" alt="SAS error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2022 16:30:31 GMT</pubDate>
    <dc:creator>Medidata</dc:creator>
    <dc:date>2022-12-13T16:30:31Z</dc:date>
    <item>
      <title>How to change colour and line style of proc liftest (kaplan graph)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849456#M37119</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am a non-professional SAS user, a medical student, so I have no idea about macros, etc. Can anyone just tell me in very simple terms how do I change the colour and style of lines in a kaplan graph (Proc lifetest)? I followed the guideline of SAS user guide and pasted this code&lt;BR /&gt;[%ProvideSurvivalMacros&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let GraphOpts = DataContrastColors=(green red blue)&lt;BR /&gt;DataColors=(green red blue);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%CompileSurvivalTemplates&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc lifetest data=WORK.IMPORT;&lt;BR /&gt;time 'Survival months1'n*'Survival months'n(1);&lt;BR /&gt;strata Stage;&lt;BR /&gt;run;]&lt;BR /&gt;&lt;BR /&gt;But I am now getting this error.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS error.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78459iB042DEB035217144/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS error.JPG" alt="SAS error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 16:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849456#M37119</guid>
      <dc:creator>Medidata</dc:creator>
      <dc:date>2022-12-13T16:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colour and line style of proc liftest (kaplan graph)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849481#M37123</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437680"&gt;@Medidata&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a prerequisite for using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;%ProvideSurvivalMacros&lt;/FONT&gt; and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;%CompileSurvivalTemplates&lt;/FONT&gt; you need to run the code provided in&amp;nbsp;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html" target="_blank" rel="noopener"&gt;https://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html&lt;/A&gt;&amp;nbsp;from&amp;nbsp;&lt;FONT face="courier new,courier"&gt;%macro ProvideSurvivalMacros;&lt;/FONT&gt;&amp;nbsp;at the beginning (the preceding comment block "&lt;FONT face="courier new,courier"&gt;S A S&amp;nbsp; &amp;nbsp;S A M P L E&amp;nbsp; &amp;nbsp;L I B R A R Y&lt;/FONT&gt;" is optional) until the very last &lt;FONT face="courier new,courier"&gt;%mend;&lt;/FONT&gt; at the bottom of the page. Just copy and paste this code into the program editor of your user interface and submit the code as you would any other code. Note that this code alone does not create any notes in the log. It just &lt;EM&gt;compiles&lt;/EM&gt; the SAS macro&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ProvideSurvivalMacros&lt;/FONT&gt;, which you then call (i.e., &lt;EM&gt;execute&lt;/EM&gt;) with&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;%&lt;/STRONG&gt;ProvideSurvivalMacros&lt;/FONT&gt;&amp;nbsp;and use with the subsequent statements (&lt;FONT face="courier new,courier"&gt;%let&lt;/FONT&gt; ... etc.) of your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: It looks like you have accidentally marked your post as an "announcement" by selecting the checkbox "&lt;SPAN&gt;No solution needed for this topic" -- which is obviously not what you intended. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Not sure if you can deselect the checkbox when editing your post (by selecting Edit from the option menu with the three-horizontal-lines icon).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 19:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849481#M37123</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-12-13T19:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colour and line style of proc liftest (kaplan graph)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849490#M37124</link>
      <description>Thank you so much. The code is now working fine.</description>
      <pubDate>Tue, 13 Dec 2022 19:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849490#M37124</guid>
      <dc:creator>Medidata</dc:creator>
      <dc:date>2022-12-13T19:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to change colour and line style of proc liftest (kaplan graph)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849605#M37137</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value grpLabel 1='ALL' 2='AML low risk' 3='AML high risk';
run;

data BMT;
        input DIAGNOSIS Ftime Status Gender@@;
        label Ftime="Days";
        format Diagnosis grpLabel.;
datalines;
1       2081       0       1       1       1602    0       1
1       1496       0       1       1       1462    0       0
1       1433       0       1       1       1377    0       1
1       1330       0       1       1       996     0       1
1       226        0       0       1       1199    0       1
1       1111       0       1       1       530     0       1
1       1182       0       0       1       1167    0       0
1       418        2       1       1       383     1       1
1       276        2       0       1       104     1       1
1       609        1       1       1       172     2       0
1       487        2       1       1       662     1       1
1       194        2       0       1       230     1       0
1       526        2       1       1       122     2       1
1       129        1       0       1       74      1       1
1       122        1       0       1       86      2       1
1       466        2       1       1       192     1       1
1       109        1       1       1       55      1       0
1       1          2       1       1       107     2       1
1       110        1       0       1       332     2       1
2       2569       0       1       2       2506    0       1
2       2409       0       1       2       2218    0       1
2       1857       0       0       2       1829    0       1
2       1562       0       1       2       1470    0       1
2       1363       0       1       2       1030    0       0
2       860        0       0       2       1258    0       0
2       2246       0       0       2       1870    0       0
2       1799       0       1       2       1709    0       0
2       1674       0       1       2       1568    0       1
2       1527       0       0       2       1324    0       1
2       957        0       1
3       2640       0       1       3       2430    0       1
3       2252       0       1       3       2140    0       1
3       2133       0       0       3       1238    0       1
3       1631       0       1       3       2024    0       0
3       1345       0       1       3       1136    0       1
3       845        0       0       3       422     1       0
3       162        2       1       3       84      1       0
3       100        1       1       3       2       2       1
3       47         1       1       3       242     1       1
3       456        1       1       3       268     1       0
3       318        2       0       3       32      1       1
3       467        1       0       3       47      1       1
3       390        1       1       3       183     2       0
3       105        2       1       3       115     1       0
3       164        2       0       3       93      1       0
3       120        1       0       3       80      2       1
3       677        2       1       3       64      1       0
3       168        2       0       3       74      2       0
3       16         2       0       3       157     1       0
3       625        1       0       3       48      1       0
3       273        1       1       3       63      2       1
3       76         1       1       3       113     1       0
3       363        2       1
;
run;

ods select none;
ods output SurvivalPlot=SurvivalPlot;
proc lifetest data=bmt plots=(survival);
time ftime*Status(0);
strata diagnosis;
run;
ods select all;



title '缓解概率';
ods graphics /ATTRPRIORITY=none;
proc sgplot data=SurvivalPlot;
styleattrs DATASYMBOLS=(plus diamond X);
step x=Time y=Survival / group=Stratum lineattrs=(pattern=solid) name='x' ;
scatter x=Time y=Censored / group=Stratum ;
legenditem name='a' type=MARKERLINE / label='ALL' MARKERATTRS=graphdata1(symbol=plus) LINEATTRS=graphdata1;
legenditem name='b' type=MARKERLINE / label='AML high risk' MARKERATTRS=graphdata2(symbol=diamond) LINEATTRS=graphdata2;
legenditem name='c' type=MARKERLINE / label='AML low risk' MARKERATTRS=graphdata3(symbol=X) LINEATTRS=graphdata3;

keylegend 'a' 'b' 'c' / across=1 location=inside position=ne ;
keylegend 'x';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1671019485239.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78490iCFE524126DB7F3B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1671019485239.png" alt="Ksharp_0-1671019485239.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
title '缓解概率';
ods graphics /ATTRPRIORITY=none;
proc sgplot data=SurvivalPlot;
styleattrs DATASYMBOLS=(plus diamond X);
step x=Time y=Survival / group=Stratum  ;
scatter x=Time y=Censored / group=Stratum ;
legenditem name='a' type=MARKERLINE / label='ALL' MARKERATTRS=graphdata1(symbol=plus) LINEATTRS=graphdata1;
legenditem name='b' type=MARKERLINE / label='AML high risk' MARKERATTRS=graphdata2(symbol=diamond) LINEATTRS=graphdata2;
legenditem name='c' type=MARKERLINE / label='AML low risk' MARKERATTRS=graphdata3(symbol=X) LINEATTRS=graphdata3;

keylegend 'a' 'b' 'c' / across=1 location=inside position=ne ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1671019506325.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78491i1E450A5DF8656416/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1671019506325.png" alt="Ksharp_1-1671019506325.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 12:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-colour-and-line-style-of-proc-liftest-kaplan-graph/m-p/849605#M37137</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-12-14T12:05:18Z</dc:date>
    </item>
  </channel>
</rss>

