<?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: Creating Graphics for Multiple Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-Graphics-for-Multiple-Variables/m-p/624687#M184059</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226533"&gt;@richaemi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to create a graph showing values over time by treatment group. Say I am looking at Hemoglobin as my variable. If I have a variable for each Hemoglobin at Baseline, Hemoglobin at 24hrs, Hemoglobin at 48 hrs, and Hemoglobin at 72hrs, and a variable for Treatment ID (Treatment A or Treatment B), is it possible to graph all of these values over time by Treatment ID in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;X axis value as the timepoint, Y axis variable as the measurement, Group by treatment. A number of different plot types may work.&lt;/P&gt;
&lt;PRE&gt;data example;
   input time meas trt;
datalines;
0    22   1
24   21   1
48   24   1
72   25   1
0    15   2
24   15   2
48   18   2
72   17   2
0    8    3
24   9    3
48   10   3
72   11   3
0    24   1
24   24   1
48   25   1
72   27   1
0   18    2
24  17    2
48  18    2
72  19    2
0   10    3
24  11    3
48  11    3
72  13    3
;
run;

proc sgplot data=example;
   /* values*/
   scatter x=time y=meas/group=trt;
   /* fit straight line through with confidence bands for the mean*/
   reg x=time y=meas/group=trt clm;
run;&lt;/PRE&gt;
&lt;P&gt;If you want to connect points that would be a series plot but you need more information to avoid having the right end of the graph try to connect back to the left end.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 23:08:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-02-13T23:08:09Z</dc:date>
    <item>
      <title>Creating Graphics for Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Graphics-for-Multiple-Variables/m-p/624664#M184052</link>
      <description>&lt;P&gt;I need to create a graph showing values over time by treatment group. Say I am looking at Hemoglobin as my variable. If I have a variable for each Hemoglobin at Baseline, Hemoglobin at 24hrs, Hemoglobin at 48 hrs, and Hemoglobin at 72hrs, and a variable for Treatment ID (Treatment A or Treatment B), is it possible to graph all of these values over time by Treatment ID in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 21:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Graphics-for-Multiple-Variables/m-p/624664#M184052</guid>
      <dc:creator>richaemi</dc:creator>
      <dc:date>2020-02-13T21:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Graphics for Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Graphics-for-Multiple-Variables/m-p/624687#M184059</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226533"&gt;@richaemi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to create a graph showing values over time by treatment group. Say I am looking at Hemoglobin as my variable. If I have a variable for each Hemoglobin at Baseline, Hemoglobin at 24hrs, Hemoglobin at 48 hrs, and Hemoglobin at 72hrs, and a variable for Treatment ID (Treatment A or Treatment B), is it possible to graph all of these values over time by Treatment ID in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;X axis value as the timepoint, Y axis variable as the measurement, Group by treatment. A number of different plot types may work.&lt;/P&gt;
&lt;PRE&gt;data example;
   input time meas trt;
datalines;
0    22   1
24   21   1
48   24   1
72   25   1
0    15   2
24   15   2
48   18   2
72   17   2
0    8    3
24   9    3
48   10   3
72   11   3
0    24   1
24   24   1
48   25   1
72   27   1
0   18    2
24  17    2
48  18    2
72  19    2
0   10    3
24  11    3
48  11    3
72  13    3
;
run;

proc sgplot data=example;
   /* values*/
   scatter x=time y=meas/group=trt;
   /* fit straight line through with confidence bands for the mean*/
   reg x=time y=meas/group=trt clm;
run;&lt;/PRE&gt;
&lt;P&gt;If you want to connect points that would be a series plot but you need more information to avoid having the right end of the graph try to connect back to the left end.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 23:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Graphics-for-Multiple-Variables/m-p/624687#M184059</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-13T23:08:09Z</dc:date>
    </item>
  </channel>
</rss>

