<?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: MAke a Plot in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760428#M240466</link>
    <description>&lt;P&gt;Your plot is going to much easier to understand and use if you have a single age and height variable with each age on a different observation per ID.&lt;/P&gt;
&lt;P&gt;The variable names you show aren't generally valid in SAS either, digits aren't acceptable by default as the first character.&lt;/P&gt;
&lt;P&gt;Three different plots using your shown values.&lt;/P&gt;
&lt;PRE&gt;data have;
   input ID $ Sex $ age_1 height_1 age_2 height_2 age_3 height_3;
datalines;
A     M       10         140       12         144       13     146
B     M       20        175        21         176       23     177
C     F       15         154       17         160       19     162
D     F       18         163       19         165       21     165
E     F       12         152       13         153       15     158
;

data toplot;
   set have;
   array a(*) Age_1-Age_3;
   array h(*) Height_1-Height_3;
   do i=1 to dim(a);
      age=a[i];
      height=h[i];
      output;
   end;
   keep id sex age height;
run;

proc sgplot data=toplot;
   /*simple scatter plot*/
   scatter x=age y=height;
run;
proc sgplot data=toplot;
   /* scatter plot showing difference by sex*/
   scatter x=age y=height/group=sex;
run;

Proc sgplot data=toplot;
   /*series grouped by Id to trace individuals*/
   series x=age y=height/ group=id;
run;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Aug 2021 17:35:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-09T17:35:52Z</dc:date>
    <item>
      <title>MAke a Plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760299#M240406</link>
      <description>&lt;P&gt;Dear. experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data like&lt;/P&gt;&lt;P&gt;ID Sex 1_age 1_height 2_age 2_height 3_age 3_height&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp;M&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;140&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;144&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13&amp;nbsp; &amp;nbsp; &amp;nbsp;146&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp;M&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 175&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;176&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23&amp;nbsp; &amp;nbsp; &amp;nbsp;177&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;F&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;154&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;160&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19&amp;nbsp; &amp;nbsp; &amp;nbsp;162&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;D&amp;nbsp; &amp;nbsp; &amp;nbsp;F&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;163&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;165&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21&amp;nbsp; &amp;nbsp; &amp;nbsp;165&lt;/P&gt;&lt;P&gt;E&amp;nbsp; &amp;nbsp; &amp;nbsp;F&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;152&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;153&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&amp;nbsp; &amp;nbsp; &amp;nbsp;158&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make linear plot and scatter plot with x axle: age and y axle: height and I want to put different color by sex .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 02:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760299#M240406</guid>
      <dc:creator>YS12</dc:creator>
      <dc:date>2021-08-09T02:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: MAke a Plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760322#M240422</link>
      <description>&lt;P&gt;Have a look at the docs of proc sgplot: &lt;A href="https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html" target="_blank"&gt;https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will, most likely have to transpose the data into a format suitable for using proc sgplot.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 07:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760322#M240422</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-08-09T07:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: MAke a Plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760332#M240427</link>
      <description>&lt;P&gt;why are there several HEIGHT variables?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 10:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760332#M240427</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-08-09T10:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: MAke a Plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760335#M240429</link>
      <description>it is follow up data. So you can see that their age and height are increased.</description>
      <pubDate>Mon, 09 Aug 2021 10:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760335#M240429</guid>
      <dc:creator>YS12</dc:creator>
      <dc:date>2021-08-09T10:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: MAke a Plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760428#M240466</link>
      <description>&lt;P&gt;Your plot is going to much easier to understand and use if you have a single age and height variable with each age on a different observation per ID.&lt;/P&gt;
&lt;P&gt;The variable names you show aren't generally valid in SAS either, digits aren't acceptable by default as the first character.&lt;/P&gt;
&lt;P&gt;Three different plots using your shown values.&lt;/P&gt;
&lt;PRE&gt;data have;
   input ID $ Sex $ age_1 height_1 age_2 height_2 age_3 height_3;
datalines;
A     M       10         140       12         144       13     146
B     M       20        175        21         176       23     177
C     F       15         154       17         160       19     162
D     F       18         163       19         165       21     165
E     F       12         152       13         153       15     158
;

data toplot;
   set have;
   array a(*) Age_1-Age_3;
   array h(*) Height_1-Height_3;
   do i=1 to dim(a);
      age=a[i];
      height=h[i];
      output;
   end;
   keep id sex age height;
run;

proc sgplot data=toplot;
   /*simple scatter plot*/
   scatter x=age y=height;
run;
proc sgplot data=toplot;
   /* scatter plot showing difference by sex*/
   scatter x=age y=height/group=sex;
run;

Proc sgplot data=toplot;
   /*series grouped by Id to trace individuals*/
   series x=age y=height/ group=id;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Aug 2021 17:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MAke-a-Plot/m-p/760428#M240466</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-09T17:35:52Z</dc:date>
    </item>
  </channel>
</rss>

