<?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: Time series with labelled text and lines in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708886#M26631</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.EXAMPLE;
infile datalines delimiter=',' truncover dsd; 
input prdate :date9. events:$100. count ;
_prdate=intnx('month',prdate,0);
format prdate _prdate ddmmyy8.;
if not missing(events) then eventcount=count;
events=cats(events,'|(',put(prdate,ddmmyy10.),')');
datalines4;
01Jan2020,., 0
27JAN2020,., 1050
28JAN2020,., 63721
29JAN2020,., 22812
30JAN2020,., 11121
01FEB2020,., 10511
02FEB2020,., 18180
11MAR2020,Lock down starts , 2345
15APR2020, Early reopening ,12356
15AUG2020,Compulsory use of masks in public transport ,46757
01SEP2020,Universities start , 34568
01OCT2020,., 3468
;;;;
ods graphics / noscale;
proc sgplot data=work.example noautolegend;
   series x=_prdate y=count / smoothconnect;
   xaxis valuesformat=monname3.;
   yaxis type=log integer ;
   text x=_prdate y=eventcount text=events
        / strip contributeoffsets=none rotate=90  position=topright
         splitchar='|' splitpolicy=splitalways;
   dropline x=_prdate y=eventcount /dropto=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53152i82D2BD86D8244D3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="x.png" alt="x.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Dec 2020 13:51:48 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-12-31T13:51:48Z</dc:date>
    <item>
      <title>Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708795#M26620</link>
      <description>&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this example dataset (In my real dataset I have different 355 combinations)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 08:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708795#M26620</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2021-01-04T08:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708803#M26621</link>
      <description>&lt;P&gt;Is the graph actually supposed to be "number tested that day" or a cumulative total or some sort of smoothing function applied to the counts? The graph you show does not appear to be a "daily count".&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2020 21:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708803#M26621</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-30T21:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708806#M26622</link>
      <description>&lt;P&gt;Is should basically be the number of tested - if thats possible?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2020 21:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708806#M26622</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-30T21:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708816#M26623</link>
      <description>&lt;P&gt;This will do a connect the dot for the date and count plot with a series statement and drop line using needle to connect the value to the specific date when an even occurs:&lt;/P&gt;
&lt;PRE&gt;data WORK.EXAMPLE;
infile datalines delimiter=',' truncover dsd; 
input prdate :date9. events:$100. count ;
format prdate ddmmyy8.;
if not missing(events) then eventcount=count;
datalines4;
01Jan2020,., 0
27JAN2020,., 1050
28JAN2020,., 63721
29JAN2020,., 22812
30JAN2020,., 11121
01FEB2020,., 10511
02FEB2020,., 18180
11MAR2020,Lock down starts, 2345
15APR2020, Early reopening,12356
15AUG2020,Compulsory use of masks in public transport,46757
01SEP2020,Universities start, 34568
01OCT2020,., 3468
;;;;

ods graphics / width=10in height=10in;
proc sgplot data=work.example;
   series x=prdate y=count;
   needle x=prdate y=eventcount;
   xaxis values=('01JAN2020'd to '01OCT2020'd by month)&lt;BR /&gt;   label=
  ;
   format prdate monname3.;&lt;BR /&gt;  yaxis label='Count of Tests'
run;
&lt;/PRE&gt;
&lt;P&gt;The left part of the graph is ugly because you have sequential days with a wide range of values so the result is very jagged: not much time on the Xaxis and lots of variance on the Yaxis values.&lt;/P&gt;
&lt;P&gt;This adds text oriented vertically but messes with the axis appearances and I don't have time to figure out all of the options that may need to be set to prevent that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=work.example;
   series x=prdate y=count;
   needle x=prdate y=eventcount;
   xaxis values=('01JAN2020'd to '01OCT2020'd by month)
  ;
   format prdate monname3.;
   text x=prdate y=eventcount text=events
        /rotate=90 position=right;
   format prdate monname3.;
run;&lt;/PRE&gt;
&lt;P&gt;You may want the NOAUTOLEGEND option on the Proc SGPLOT statement to suppress the legend since both automatic items are basically the same value displayed in different manner.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2020 22:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708816#M26623</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-30T22:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708886#M26631</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.EXAMPLE;
infile datalines delimiter=',' truncover dsd; 
input prdate :date9. events:$100. count ;
_prdate=intnx('month',prdate,0);
format prdate _prdate ddmmyy8.;
if not missing(events) then eventcount=count;
events=cats(events,'|(',put(prdate,ddmmyy10.),')');
datalines4;
01Jan2020,., 0
27JAN2020,., 1050
28JAN2020,., 63721
29JAN2020,., 22812
30JAN2020,., 11121
01FEB2020,., 10511
02FEB2020,., 18180
11MAR2020,Lock down starts , 2345
15APR2020, Early reopening ,12356
15AUG2020,Compulsory use of masks in public transport ,46757
01SEP2020,Universities start , 34568
01OCT2020,., 3468
;;;;
ods graphics / noscale;
proc sgplot data=work.example noautolegend;
   series x=_prdate y=count / smoothconnect;
   xaxis valuesformat=monname3.;
   yaxis type=log integer ;
   text x=_prdate y=eventcount text=events
        / strip contributeoffsets=none rotate=90  position=topright
         splitchar='|' splitpolicy=splitalways;
   dropline x=_prdate y=eventcount /dropto=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53152i82D2BD86D8244D3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="x.png" alt="x.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2020 13:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708886#M26631</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-12-31T13:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708888#M26632</link>
      <description />
      <pubDate>Mon, 04 Jan 2021 08:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708888#M26632</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2021-01-04T08:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708892#M26634</link>
      <description>There are some outliers in your data. remove these extreme large data at xaxis .&lt;BR /&gt;and do't forget PROC SORT + BY prdate ,before PROC SGPLOT .</description>
      <pubDate>Thu, 31 Dec 2020 14:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708892#M26634</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-12-31T14:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708893#M26635</link>
      <description>Notice , I used "x=_prdate " NOT "x=prdate " . _prdate is a new variable I made in data step.</description>
      <pubDate>Thu, 31 Dec 2020 14:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708893#M26635</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-12-31T14:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708991#M26649</link>
      <description>&lt;P&gt;opå&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 08:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708991#M26649</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2021-01-04T08:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708996#M26652</link>
      <description>&lt;P&gt;Ou, Maybe you need summary it before plot it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.EXAMPLE;
infile datalines delimiter=',' truncover dsd; 
input prdate :date9. events:$100. count ;
_prdate=intnx('month',prdate,0);
format prdate _prdate ddmmyy8.;
if not missing(events) then do;
 eventcount=count;
events=cats(events,'|(',put(prdate,ddmmyy10.),')');
end;
datalines4;
01Jan2020,., 0
27JAN2020,., 1050
28JAN2020,., 63721
29JAN2020,., 22812
30JAN2020,., 11121
01FEB2020,., 10511
02FEB2020,., 18180
11MAR2020,Lock down starts , 2345
15APR2020, Early reopening ,12356
15AUG2020,Compulsory use of masks in public transport ,46757
01SEP2020,Universities start , 34568
01OCT2020,., 3468
;;;;

proc summary data=example nway;
class _prdate events/missing;
var count eventcount;
output out=have sum=;
run;

ods graphics / noscale;
proc sgplot data=work.have noautolegend;
   series x=_prdate y=count/smoothconnect ;
   xaxis valuesformat=monname3.;
   text x=_prdate y=eventcount text=events
        / strip contributeoffsets=none rotate=90  position=topright
         splitchar='|' splitpolicy=splitalways;
   dropline x=_prdate y=eventcount /dropto=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53168iF0BAEB1747550981/image-size/large?v=v2&amp;amp;px=999" role="button" title="x.png" alt="x.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2021 12:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/708996#M26652</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-01T12:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Time series with labelled text and lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/709017#M26659</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/353472"&gt;@mmea&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It works - but do not look good - is there tips and tricks to do something different so it will come out nicer?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Define "nicer".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to go back to the first response where I specifically asked if you needed a "smoothing" function applied.&lt;/P&gt;
&lt;P&gt;Which would likely have lead to a discussion about what type of smoothing needs to be applied, which would likely be dependent on the data that you have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2021 19:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Time-series-with-labelled-text-and-lines/m-p/709017#M26659</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-01T19:51:42Z</dc:date>
    </item>
  </channel>
</rss>

