<?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 PROC SGPLOT plotting values that are not in set? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517768#M3404</link>
    <description>&lt;P&gt;I'm manipulating an existing dataset using PROC TIMESERIES - specifically aggregating 5 minute values into hours and doing this many days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try plotting the hours there are some values being plotted that are not supposed to be there, and I can't find them in the dataset either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TIMESERIES data=examlib.china out=a3;
id dato_tid interval=hour
accumulate=total
setmissing=missing; 
var antal;
run;
data a4; 
set a3;
hh=hour(dato_tid);
dd=weekday(datepart(dato_tid));
run;
PROC SGPLOT data=a4;
series x=hh y=antal;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;getting this plot, with wrong values also printed in&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25306iBE870FF4280054B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Trying to locate these values in the dataset yields no results.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PRINT data=a4;
var antal;
where hh=10 and antal&amp;lt;600;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 93px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25307iA6FA929E43CACE5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The only thing it finds is the missing values (there is a day with missing values), but none of the plotted values which are non-zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas what I'm doing wrong here? Any and all help much appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Dec 2018 22:19:46 GMT</pubDate>
    <dc:creator>TheSASNovice</dc:creator>
    <dc:date>2018-12-01T22:19:46Z</dc:date>
    <item>
      <title>PROC SGPLOT plotting values that are not in set?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517768#M3404</link>
      <description>&lt;P&gt;I'm manipulating an existing dataset using PROC TIMESERIES - specifically aggregating 5 minute values into hours and doing this many days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try plotting the hours there are some values being plotted that are not supposed to be there, and I can't find them in the dataset either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TIMESERIES data=examlib.china out=a3;
id dato_tid interval=hour
accumulate=total
setmissing=missing; 
var antal;
run;
data a4; 
set a3;
hh=hour(dato_tid);
dd=weekday(datepart(dato_tid));
run;
PROC SGPLOT data=a4;
series x=hh y=antal;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;getting this plot, with wrong values also printed in&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25306iBE870FF4280054B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Trying to locate these values in the dataset yields no results.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PRINT data=a4;
var antal;
where hh=10 and antal&amp;lt;600;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 93px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25307iA6FA929E43CACE5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The only thing it finds is the missing values (there is a day with missing values), but none of the plotted values which are non-zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas what I'm doing wrong here? Any and all help much appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 22:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517768#M3404</guid>
      <dc:creator>TheSASNovice</dc:creator>
      <dc:date>2018-12-01T22:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT plotting values that are not in set?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517769#M3405</link>
      <description>&lt;P&gt;You are just looking at the line joining consecutive days. Try this instead;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a4; 
set a3;
hh=timepart(dato_tid);
dd=datepart(dato_tid);
run;

PROC SGPLOT data=a4;
series x=hh y=antal / group=dd lineattrs=(pattern=solid color=blue);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 22:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517769#M3405</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-01T22:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT plotting values that are not in set?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517771#M3406</link>
      <description>&lt;P&gt;Fantastic. Thanks so much mate! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25308i8D8726E747790930/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess the only thing I need to fix is the xaxis, as it should ideally be showing hours. I will try to work in this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are hourly traffic stats btw, for anyone interested &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Converting to hours was easy. One small change in code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a4; 
set a3;
hh=timepart(dato_tid);
dd=datepart(dato_tid);
hh=hh/3600; *convert to hour format by dividing by seconds in hour;
run;

PROC SGPLOT data=a4;
series x=hh y=antal / group=dd lineattrs=(pattern=solid color=blue);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25309i26F5EEF91EEAB099/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 22:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SGPLOT-plotting-values-that-are-not-in-set/m-p/517771#M3406</guid>
      <dc:creator>TheSASNovice</dc:creator>
      <dc:date>2018-12-01T22:56:28Z</dc:date>
    </item>
  </channel>
</rss>

