<?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: overlaid KM and PH curves with unwanted connecting lines with SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456383#M15683</link>
    <description>&lt;P&gt;Thanks PG for replying and helping me with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the suggested code and my problem is still persisting. I am playing around with the break option and trying to set different Y values to missing. Do you think I need to change all values of the last arm or tR (time) for the graph to display correctly. Additionally,&amp;nbsp;maybe I need to also set first values to missing?&lt;/P&gt;&lt;P&gt;Thanks again and any more brain power is appreciated, but obviously not assumed.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 03:14:13 GMT</pubDate>
    <dc:creator>mkm063</dc:creator>
    <dc:date>2018-04-23T03:14:13Z</dc:date>
    <item>
      <title>overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456288#M15671</link>
      <description>&lt;P&gt;Hi, I am using SAS University Edition. I am trying to overlay a KM curve and PH curve to see if they match relatively well. I can overlay them, but the PH curves have lines connecting the starting point and ending point. Can someone help me remove these lines?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data=Allhiv33;
class arm;
model (tL,tR)*status(0)=arm;
baseline out=bb covariates=covs survival=s cumhaz=Ht ;
run;

proc lifetest data=allhiv2 outsurv=c ;
time inf_time*delta(0);
strata arm;
run;

data b_new;
set bb;
length Z $27;
if arm="DMPA" then Z="PH DMPA"; 
if arm="IUD" then Z="PH IUD"; 
if arm="Jadelle" then Z="PH Jadelle"; 
run;

data c_new;
set c(rename=(survival=s inf_time=tR));
length Z $27;
if arm="DMPA" then Z="KM DMPA"; 
if arm="IUD" then Z="KM IUD"; 
if arm="Jadelle" then Z="KM Jadelle"; 
run;

data both_arms;
set b_new c_new;
run;

proc sgplot data=both_arms;
series x=tR y=s / group=Z ;
run;
** neither sgplot rids of connecting lines;
proc sgplot data=both_arms;
step y=s x=tR / group=z;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snip20180422_1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20021i7980311493B0C8EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Snip20180422_1.png" alt="Snip20180422_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 13:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456288#M15671</guid>
      <dc:creator>mkm063</dc:creator>
      <dc:date>2018-04-22T13:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456377#M15682</link>
      <description>&lt;P&gt;Add missing values to create breaks in the lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data both_arms;
set b_new c_new;
by Z notsorted;
output;
if last.Z then do;
    call missing(s);
    output;
    end;
run;

proc sgplot data=both_arms;
series x=tR y=s / group=Z break;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Apr 2018 03:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456377#M15682</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-04-23T03:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456383#M15683</link>
      <description>&lt;P&gt;Thanks PG for replying and helping me with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the suggested code and my problem is still persisting. I am playing around with the break option and trying to set different Y values to missing. Do you think I need to change all values of the last arm or tR (time) for the graph to display correctly. Additionally,&amp;nbsp;maybe I need to also set first values to missing?&lt;/P&gt;&lt;P&gt;Thanks again and any more brain power is appreciated, but obviously not assumed.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 03:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456383#M15683</guid>
      <dc:creator>mkm063</dc:creator>
      <dc:date>2018-04-23T03:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456970#M15712</link>
      <description>&lt;P&gt;Try sorting the data before you plot it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=both_arms;
by Z tR;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456970#M15712</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-04-24T17:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456984#M15713</link>
      <description>&lt;P&gt;Wow- sorting with the break option worked. Thank you both for helping solve this problem!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456984#M15713</guid>
      <dc:creator>mkm063</dc:creator>
      <dc:date>2018-04-24T17:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456986#M15714</link>
      <description>&lt;P&gt;I don't think you need the missing values or the BREAK option, but I could be mistaken.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456986#M15714</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-04-24T17:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: overlaid KM and PH curves with unwanted connecting lines with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456989#M15715</link>
      <description>&lt;P&gt;I just tried it again without the break option, and you're right. I just needed to sort my combined dataset. Thanks for the problem solving!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlaid-KM-and-PH-curves-with-unwanted-connecting-lines-with/m-p/456989#M15715</guid>
      <dc:creator>mkm063</dc:creator>
      <dc:date>2018-04-24T17:48:31Z</dc:date>
    </item>
  </channel>
</rss>

