<?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 plot this output for each group over time in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/how-to-plot-this-output-for-each-group-over-time/m-p/494596#M6185</link>
    <description>&lt;P&gt;You need to change your data structure. If it's in a long format this is a trivial exercise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reformat your data to have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Group Time Measurement&lt;/P&gt;
&lt;P&gt;1 1 XX&lt;/P&gt;
&lt;P&gt;1 2 XX&lt;/P&gt;
&lt;P&gt;1 3 XX&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;2 1 XX&lt;/P&gt;
&lt;P&gt;2 2 XX&lt;/P&gt;
&lt;P&gt;..&lt;/P&gt;
&lt;P&gt;4 7 XX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then your graphing statement becomes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=transposed;
series x=time y=measurement / group=group;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/229120"&gt;@Mo2018&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I am trying to plot the mean for each group over time&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have calculated the mean for each group at each time ( time from 1 to 7 i.e seven time points )&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my output look like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture555.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23200iA3A5027253100CCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture555.PNG" alt="Capture555.PNG" /&gt;&lt;/span&gt;so I want to plot the group 1 with the first row( mtime1 to mtime7 over seven time pionts)&lt;/P&gt;
&lt;P&gt;and same for group 2 with the second row and same with group 3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to do something like that but it did not work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=insulin3 mean; by group;
  var time1 time2 time3 time4 time5 time6 time7;
  output out=new mean=mtime1 mtime2 mtime3 mtime4 mtime5 mtime6 mtime7;
run;

proc print data = new;
run;

proc sgplot  data=new;
 scatter x=group y=mtime1;  
 run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used sgplot because proc gplot is not available in SAS studio.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your help&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Sep 2018 18:21:50 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-09-11T18:21:50Z</dc:date>
    <item>
      <title>how to plot this output for each group over time</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-plot-this-output-for-each-group-over-time/m-p/494594#M6184</link>
      <description>&lt;P&gt;Hi, I am trying to plot the mean for each group over time&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have calculated the mean for each group at each time ( time from 1 to 7 i.e seven time points )&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my output look like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture555.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23200iA3A5027253100CCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture555.PNG" alt="Capture555.PNG" /&gt;&lt;/span&gt;so I want to plot the group 1 with the first row( mtime1 to mtime7 over seven time pionts)&lt;/P&gt;&lt;P&gt;and same for group 2 with the second row and same with group 3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to do something like that but it did not work&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=insulin3 mean; by group;
  var time1 time2 time3 time4 time5 time6 time7;
  output out=new mean=mtime1 mtime2 mtime3 mtime4 mtime5 mtime6 mtime7;
run;

proc print data = new;
run;

proc sgplot  data=new;
 scatter x=group y=mtime1;  
 run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I used sgplot because proc gplot is not available in SAS studio.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 18:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-plot-this-output-for-each-group-over-time/m-p/494594#M6184</guid>
      <dc:creator>Mo2018</dc:creator>
      <dc:date>2018-09-11T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to plot this output for each group over time</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-plot-this-output-for-each-group-over-time/m-p/494596#M6185</link>
      <description>&lt;P&gt;You need to change your data structure. If it's in a long format this is a trivial exercise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reformat your data to have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Group Time Measurement&lt;/P&gt;
&lt;P&gt;1 1 XX&lt;/P&gt;
&lt;P&gt;1 2 XX&lt;/P&gt;
&lt;P&gt;1 3 XX&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;2 1 XX&lt;/P&gt;
&lt;P&gt;2 2 XX&lt;/P&gt;
&lt;P&gt;..&lt;/P&gt;
&lt;P&gt;4 7 XX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then your graphing statement becomes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=transposed;
series x=time y=measurement / group=group;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/229120"&gt;@Mo2018&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I am trying to plot the mean for each group over time&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have calculated the mean for each group at each time ( time from 1 to 7 i.e seven time points )&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my output look like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture555.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23200iA3A5027253100CCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture555.PNG" alt="Capture555.PNG" /&gt;&lt;/span&gt;so I want to plot the group 1 with the first row( mtime1 to mtime7 over seven time pionts)&lt;/P&gt;
&lt;P&gt;and same for group 2 with the second row and same with group 3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to do something like that but it did not work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=insulin3 mean; by group;
  var time1 time2 time3 time4 time5 time6 time7;
  output out=new mean=mtime1 mtime2 mtime3 mtime4 mtime5 mtime6 mtime7;
run;

proc print data = new;
run;

proc sgplot  data=new;
 scatter x=group y=mtime1;  
 run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used sgplot because proc gplot is not available in SAS studio.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your help&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 18:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-plot-this-output-for-each-group-over-time/m-p/494596#M6185</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-11T18:21:50Z</dc:date>
    </item>
  </channel>
</rss>

