<?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 do I change the atributes of a line in a step plot (Kaplan-Meier) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966533#M25526</link>
    <description>&lt;PRE&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       2       932     0       0
2       847        0       1       2       848     0       1
2       1850       0       0       2       1843    0       0
2       1535       0       0       2       1447    0       0
2       1384       0       0       2       414     2       1
2       2204       2       0       2       1063    2       1
2       481        2       1       2       105     2       1
2       641        2       1       2       390     2       1
2       288        2       1       2       421     1       1
2       79         2       0       2       748     1       1
2       486        1       0       2       48      2       0
2       272        1       0       2       1074    2       1
2       381        1       0       2       10      2       1
2       53         2       0       2       80      2       0
2       35         2       0       2       248     1       1
2       704        2       0       2       211     1       1
2       219        1       1       2       606     1       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 '缓解概率';
&lt;STRONG&gt;ods graphics /ATTRPRIORITY=none;&lt;/STRONG&gt;
proc sgplot data=SurvivalPlot;
step x=Time y=Survival / group=Stratum name='x' &lt;STRONG&gt;lineattrs=(color=black)&lt;/STRONG&gt; ;
scatter x=Time y=Censored / group=Stratum &lt;STRONG&gt;markerattrs=(symbol=plus color=black)&lt;/STRONG&gt; ;
inset 'Censored    +'/position=ne border;
keylegend 'x' / title='Treatment' location=outside ;
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1747276015374.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106929i3E468B3BFCE2AA8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1747276015374.png" alt="Ksharp_0-1747276015374.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 May 2025 02:27:13 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-05-15T02:27:13Z</dc:date>
    <item>
      <title>How do I change the atributes of a line in a step plot (Kaplan-Meier)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966510#M25524</link>
      <description>&lt;P&gt;I received the following code from a researcher written by her previous programmer.&amp;nbsp; SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*****&lt;BR /&gt;ESTIMATING AND PLOTTING K-M curves for HTN&lt;BR /&gt;******/&lt;BR /&gt;ods graphics on;&lt;BR /&gt;*ods trace on;&lt;BR /&gt;ods output SurvivalPlot=sp2 HomTests=pval1;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Logrank test for composite outcome-KM;&lt;/P&gt;&lt;P&gt;proc lifetest data=tab2 plots =SURVIVAL (nocensor test atrisk(atrisktick maxlen=13 outside)=0 50 100 150 200 250);&lt;BR /&gt;time ptime*event_hbp(0);&lt;BR /&gt;strata sdbetweenter / order=internal;&lt;BR /&gt;*Yaxis values=(0.75 to 1.00 by 0.05);&lt;BR /&gt;*Xaxis label = 'Months of Follow-up';&lt;BR /&gt;*title 'Logrank test for coping and all events';&lt;BR /&gt;run; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set pval1(where=(lowcase(test) eq "log-rank"));&lt;BR /&gt;call symputx("LRPV",put(ProbChiSq,6.4),"G");&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods select all;&lt;BR /&gt;title "Kaplan-Meier Estimates for Hypertension";&lt;BR /&gt;title2 height=0.8 "With Number of Subjects at Risk (cause-specific)";&lt;BR /&gt;proc sgplot data=sp2 ;&lt;BR /&gt;step x=time y=survival / group=stratum name='s' lineattrs=(pattern=LongDashShortDash color=yellow);&lt;BR /&gt;keylegend 's' / location=inside title="Coping variability levels";&lt;BR /&gt;Xaxis label="Time from baseline (Months)" labelattrs=(weight=bold);&lt;BR /&gt;Yaxis label="Survival Percentage" labelattrs=(weight=bold) values=(0.65 to 1.00 by 0.05);&lt;BR /&gt;inset "Log-Rank p = &amp;amp;LRPV." / position=top border;&lt;BR /&gt;xaxistable atrisk / x=tatrisk class=stratum /*colorgroup=stratum*/ location=outside;&lt;BR /&gt;scatter x=time y=censored / markerattrs=(color=black symbol=Plus size=1) name='c';&lt;BR /&gt;scatter x=time y=censored / markerattrs=(symbol=Circle size=1) group=stratum;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to modify it to satisfy all desired changes with the exception of two.&lt;/P&gt;&lt;P&gt;1. Change all the colors to black or grayscale&lt;/P&gt;&lt;P&gt;2. Instead of color being the identifying characteristic for each Kaplan-Meier curve , use "line styles" such as dotted line, dashed line, dot-dash-dot line, and&amp;nbsp; solid line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been some headway using the lineattrs and pattern options, however every lines gets the same treatment and I need to distinguish them with separate treatments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&amp;nbsp; Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Scott&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 18:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966510#M25524</guid>
      <dc:creator>SGScott</dc:creator>
      <dc:date>2025-05-14T18:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the atributes of a line in a step plot (Kaplan-Meier)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966512#M25525</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this chapter, I demonstrated every KM customization that I ever heard customers wanted (at least until I retired).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know about ODS styles? They provide many options for color and appearance customization. There is some info on styles in that chapter.&lt;/P&gt;
&lt;P&gt;You might also want to look at:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_odsgraph_toc.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_odsgraph_toc.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 19:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966512#M25525</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2025-05-14T19:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the atributes of a line in a step plot (Kaplan-Meier)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966533#M25526</link>
      <description>&lt;PRE&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       2       932     0       0
2       847        0       1       2       848     0       1
2       1850       0       0       2       1843    0       0
2       1535       0       0       2       1447    0       0
2       1384       0       0       2       414     2       1
2       2204       2       0       2       1063    2       1
2       481        2       1       2       105     2       1
2       641        2       1       2       390     2       1
2       288        2       1       2       421     1       1
2       79         2       0       2       748     1       1
2       486        1       0       2       48      2       0
2       272        1       0       2       1074    2       1
2       381        1       0       2       10      2       1
2       53         2       0       2       80      2       0
2       35         2       0       2       248     1       1
2       704        2       0       2       211     1       1
2       219        1       1       2       606     1       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 '缓解概率';
&lt;STRONG&gt;ods graphics /ATTRPRIORITY=none;&lt;/STRONG&gt;
proc sgplot data=SurvivalPlot;
step x=Time y=Survival / group=Stratum name='x' &lt;STRONG&gt;lineattrs=(color=black)&lt;/STRONG&gt; ;
scatter x=Time y=Censored / group=Stratum &lt;STRONG&gt;markerattrs=(symbol=plus color=black)&lt;/STRONG&gt; ;
inset 'Censored    +'/position=ne border;
keylegend 'x' / title='Treatment' location=outside ;
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1747276015374.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106929i3E468B3BFCE2AA8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1747276015374.png" alt="Ksharp_0-1747276015374.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 02:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/966533#M25526</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-05-15T02:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the atributes of a line in a step plot (Kaplan-Meier)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/967120#M25538</link>
      <description>WarrenKuhfeld, Thank you for your assitance I have bookmarked and downloaded your voluminous information. I expect to use it many times in the future.</description>
      <pubDate>Wed, 21 May 2025 15:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/967120#M25538</guid>
      <dc:creator>SGScott</dc:creator>
      <dc:date>2025-05-21T15:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the atributes of a line in a step plot (Kaplan-Meier)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/967121#M25539</link>
      <description>Thank you Ksharp. This is what I was looking for. Your graph is much easier to read than mine is. I wish I were able to use colors.</description>
      <pubDate>Wed, 21 May 2025 15:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-change-the-atributes-of-a-line-in-a-step-plot-Kaplan/m-p/967121#M25539</guid>
      <dc:creator>SGScott</dc:creator>
      <dc:date>2025-05-21T15:33:35Z</dc:date>
    </item>
  </channel>
</rss>

