<?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: SGPLOT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485841#M126281</link>
    <description>&lt;P&gt;What is your expected report?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 16:11:46 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-08-10T16:11:46Z</dc:date>
    <item>
      <title>SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485827#M126273</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sampled;
infile datalines truncover;
 input trtgrp subject time  ipred ;
   datalines;
1 1 0 0
1 1 0.4 7
1 1 0.7 11
1 1 1 15
1 1 2 20
1 1 3 23
1 1 5 20
1 1 6 17
1 1 8   19
1 1 10  16
1 2 0 0
1 2 0.6 7.74
1 2 1.04 10.4
1 2 2.99 17.2
1 2 3.84 17.6
1 2 6.22 16.4
1 2 8 18.4
1 2 10 16.5
   ;
   run;


proc sgplot data=SAMPLED;
   title 'Study Results by Subject';
   series x=time y=IPRED / group=TRTgrp grouplc=TRTGRP name='grouping';
   keylegend 'grouping' / type=linecolor;  
  
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The graph has a line at the bottom connecting the 0 and 10 hr time point for subject 1.&amp;nbsp; Can someone tell me why and how to get rid of the line?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 15:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485827#M126273</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2018-08-10T15:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485838#M126278</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sampled;
infile datalines truncover;
 input trtgrp subject time  ipred ;
   datalines;
1 1 0 0
1 1 0.4 7
1 1 0.7 11
1 1 1 15
1 1 2 20
1 1 3 23
1 1 5 20
1 1 6 17
1 1 8   19
1 1 10  16
1 2 0 0
1 2 0.6 7.74
1 2 1.04 10.4
1 2 2.99 17.2
1 2 3.84 17.6
1 2 6.22 16.4
1 2 8 18.4
1 2 10 16.5
   ;
   run;


proc sgplot data=SAMPLED;
   title 'Study Results by Subject';
   series x=time y=IPRED / group=TRTgrp grouplc=TRTGRP name='grouping';
   keylegend 'grouping' / type=linecolor;  
  
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The graph has a line at the bottom connecting the 0 and 10 hr time point for subject 1.&amp;nbsp; Can someone tell me why and how to get rid of the line?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are you sure you meant to use TRTgrp as the group variable? Since all of your records are from the same TRTGrp then that is what happens when the x values start over again for subject 2. See if using GROUP=SUBJECT creates the desired appearance.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485838#M126278</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-10T16:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485841#M126281</link>
      <description>&lt;P&gt;What is your expected report?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485841#M126281</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-08-10T16:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485853#M126286</link>
      <description>&lt;P&gt;Yes, that resolved the issue.&amp;nbsp; My follow-up question is that the final data set will have separate treatment groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore if I correctly interpret the expected result when I have more than one group would be to at that time have group=trtgrp and then it should plot ok?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485853#M126286</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2018-08-10T16:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485880#M126292</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, that resolved the issue.&amp;nbsp; My follow-up question is that the final data set will have separate treatment groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore if I correctly interpret the expected result when I have more than one group would be to at that time have group=trtgrp and then it should plot ok?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that you likely will want to insert a record at the end of each treatment subject combination with a missing Y value and use the BREAK option on the series statement to prevent the connection from last subject to next. Obviously the data below for trtgrp 2 is made up by me and has no actual relationship to your values. With my example data the appearance is actually the same for Group=trtgrp or Group=subject.&lt;/P&gt;
&lt;P&gt;I would also suggest a label for your legend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data sampled;
infile datalines truncover;
 input trtgrp subject time  ipred ;
   datalines;
1 1 0 0
1 1 0.4 7
1 1 0.7 11
1 1 1 15
1 1 2 20
1 1 3 23
1 1 5 20
1 1 6 17
1 1 8   19
1 1 10  16
1 2 0 0
1 2 0.6 7.74
1 2 1.04 10.4
1 2 2.99 17.2
1 2 3.84 17.6
1 2 6.22 16.4
1 2 8 18.4
1 2 10 16.5
2 3 0 0
2 3 0.8 8.0
2 3 1.1 9.9
2 3 4.60 14.50
2 3 7.1 13.9
2 3 9.50 12.80
2 4 0 0
2 4 0.3 5.0
2 4 2.80 13.0
2 4 5.0 16.60
2 4 8.70 16.40
2 4 9.30 13.40
   ;
   run;
proc sort data=sampled;
   by trtgrp subject time;
run;
data plot;
   set sampled;
   by trtgrp subject;
   output;
   if last.subject then do;
      ipred=.;
      output;
   end;
run;


proc sgplot data=plot;
   title 'Study Results by Subject';
   series x=time y=IPRED / group=TRTGRP grouplc=TRTGRP break name='grouping';
   keylegend 'grouping' / type=linecolor;  
  
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485880#M126292</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-10T17:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485902#M126303</link>
      <description>Thanks for the update and I will use your suggestion for my final plot.&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Aug 2018 18:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT/m-p/485902#M126303</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2018-08-10T18:10:22Z</dc:date>
    </item>
  </channel>
</rss>

