<?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: Making two groups: Weekends and Weekdays in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471379#M30552</link>
    <description>&lt;P&gt;Sorry this was a bad data example. Here's better representation&lt;/P&gt;&lt;PRE&gt;input load day month temperature
datalines:
12345 0 12 35
12456 1 12 33
12222 2 12 32
14532 3 12 31
15111 4 12 25
15222 5 12 24
15333 6 12 33
;&lt;/PRE&gt;&lt;P&gt;And now I want to do a grouped scatter plot:&lt;/P&gt;&lt;PRE&gt;   proc sgplot data=dataname;
      title 'Weekend Load vs Weekday Load';
      scatter x=Temperature y=Load / group=?? Weekend or Wekkday ??;
   run;&lt;/PRE&gt;&lt;P&gt;how would I edit my code so it counts day 0 and 6 as weekend and the rest as weekdays?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jun 2018 14:37:02 GMT</pubDate>
    <dc:creator>matt23</dc:creator>
    <dc:date>2018-06-19T14:37:02Z</dc:date>
    <item>
      <title>Making two groups: Weekends and Weekdays</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471371#M30550</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My data looks something like this:&lt;/P&gt;&lt;PRE&gt;input load day month 
datalines:
12345 0 12
12456 1 12
12222 2 12
14532 3 12
15111 4 12
15222 5 12
15333 6 12
;&lt;/PRE&gt;&lt;P&gt;and so on. I want to group&amp;nbsp;into weekdays and weekends where day (6,0) = weekend and (1,2,3,4,5) = weekday&lt;/P&gt;&lt;P&gt;and then make a scatterplot to compare weekend load vs weekday load&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 14:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471371#M30550</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-06-19T14:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Making two groups: Weekends and Weekdays</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471372#M30551</link>
      <description>&lt;P&gt;With minimal information to go on:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length period $20;
  period=ifc(day in (6,0),"Weekend","Weekday");
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 14:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471372#M30551</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-19T14:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Making two groups: Weekends and Weekdays</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471379#M30552</link>
      <description>&lt;P&gt;Sorry this was a bad data example. Here's better representation&lt;/P&gt;&lt;PRE&gt;input load day month temperature
datalines:
12345 0 12 35
12456 1 12 33
12222 2 12 32
14532 3 12 31
15111 4 12 25
15222 5 12 24
15333 6 12 33
;&lt;/PRE&gt;&lt;P&gt;And now I want to do a grouped scatter plot:&lt;/P&gt;&lt;PRE&gt;   proc sgplot data=dataname;
      title 'Weekend Load vs Weekday Load';
      scatter x=Temperature y=Load / group=?? Weekend or Wekkday ??;
   run;&lt;/PRE&gt;&lt;P&gt;how would I edit my code so it counts day 0 and 6 as weekend and the rest as weekdays?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 14:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471379#M30552</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-06-19T14:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Making two groups: Weekends and Weekdays</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471384#M30553</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216327"&gt;@matt23&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry this was a bad data example. Here's better representation&lt;/P&gt;
&lt;PRE&gt;input load day month temperature
datalines:
12345 0 12 35
12456 1 12 33
12222 2 12 32
14532 3 12 31
15111 4 12 25
15222 5 12 24
15333 6 12 33
;&lt;/PRE&gt;
&lt;P&gt;And now I want to do a grouped scatter plot:&lt;/P&gt;
&lt;PRE&gt;   proc sgplot data=dataname;
      title 'Weekend Load vs Weekday Load';
      scatter x=Temperature y=Load / group=?? Weekend or Wekkday ??;
   run;&lt;/PRE&gt;
&lt;P&gt;how would I edit my code so it counts day 0 and 6 as weekend and the rest as weekdays?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;'s code to add period (or other likely variable name) and use that variable with the group= option.&lt;/P&gt;
&lt;P&gt;Or create a custom format, apply that format to the day variable and use day as the group variable.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 14:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471384#M30553</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-19T14:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Making two groups: Weekends and Weekdays</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471396#M30555</link>
      <description>&lt;P&gt;Close.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You create the weekday variable as indicated by a previous poster. That value is stored in the variable PERIOD. Then you would put that variable name in the GROUP = section.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input load day month temperature;
weekday_end = ifc(day in (0,6), 'Weekend', 'Weekday', .);
datalines;
12345 0 12 35
12456 1 12 33
12222 2 12 32
14532 3 12 31
15111 4 12 25
15222 5 12 24
15333 6 12 33
;
   proc sgplot data=have;
      title 'Weekend Load vs Weekday Load';
      scatter x=Temperature y=Load / group= weekday_end;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216327"&gt;@matt23&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry this was a bad data example. Here's better representation&lt;/P&gt;
&lt;PRE&gt;input load day month temperature
datalines:
12345 0 12 35
12456 1 12 33
12222 2 12 32
14532 3 12 31
15111 4 12 25
15222 5 12 24
15333 6 12 33
;&lt;/PRE&gt;
&lt;P&gt;And now I want to do a grouped scatter plot:&lt;/P&gt;
&lt;PRE&gt;   proc sgplot data=dataname;
      title 'Weekend Load vs Weekday Load';
      scatter x=Temperature y=Load / group=?? Weekend or Wekkday ??;
   run;&lt;/PRE&gt;
&lt;P&gt;how would I edit my code so it counts day 0 and 6 as weekend and the rest as weekdays?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 15:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Making-two-groups-Weekends-and-Weekdays/m-p/471396#M30555</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-19T15:04:32Z</dc:date>
    </item>
  </channel>
</rss>

