<?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: How to color or label ewmachart by different periods? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921288#M45779</link>
    <description>&lt;P&gt;Is there a fully reproducible code for the chart mentioned in the post?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2024 13:21:27 GMT</pubDate>
    <dc:creator>Giovani</dc:creator>
    <dc:date>2024-03-21T13:21:27Z</dc:date>
    <item>
      <title>How to color or label ewmachart by different periods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921037#M45755</link>
      <description>&lt;P&gt;Using the procedure listed here, I am looking to add different visual information, either using color or a label for the time variable in the EWMA chart output. Any help is welcome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Sample;&lt;BR /&gt;input Sample Diameter Time $;&lt;BR /&gt;datalines;&lt;BR /&gt;1 24.05 Morning&lt;BR /&gt;2 23.99 Morning&lt;BR /&gt;3 23.95 Morning&lt;BR /&gt;4 23.93 Morning&lt;BR /&gt;5 23.97 Morning&lt;BR /&gt;6 24.02 Morning&lt;BR /&gt;7 24.06 Morning&lt;BR /&gt;8 24.10 Morning&lt;BR /&gt;9 23.98 Morning&lt;BR /&gt;10 24.03 Afternoon&lt;BR /&gt;11 23.91 Afternoon&lt;BR /&gt;12 24.06 Afternoon&lt;BR /&gt;13 24.06 Afternoon&lt;BR /&gt;14 23.96 Afternoon&lt;BR /&gt;15 23.98 Afternoon&lt;BR /&gt;16 24.06 Afternoon&lt;BR /&gt;17 24.01 Afternoon&lt;BR /&gt;18 24.00 Afternoon&lt;BR /&gt;19 23.93 Afternoon&lt;BR /&gt;20 23.92 Afternoon&lt;BR /&gt;21 24.09 Morning&lt;BR /&gt;22 24.11 Morning&lt;BR /&gt;23 24.05 Morning&lt;BR /&gt;24 23.98 Morning&lt;BR /&gt;25 23.98 Morning&lt;BR /&gt;26 24.06 Morning&lt;BR /&gt;27 24.02 Morning&lt;BR /&gt;28 24.06 Morning&lt;BR /&gt;29 23.97 Morning&lt;BR /&gt;30 23.96 Morning&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;proc MACONTROL data=work.Sample ;&lt;BR /&gt;ewmachart Diameter * Sample / &lt;BR /&gt;weight = 0.4&lt;BR /&gt;sigmas = 3.0&lt;BR /&gt;outlimits = c;&lt;BR /&gt;label Diameter = "Diameter";&lt;BR /&gt;label Sample = "Sample";&lt;BR /&gt;run;&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="Giovani_2-1710900182030.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94781i27E475B7E4A057A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Giovani_2-1710900182030.png" alt="Giovani_2-1710900182030.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 02:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921037#M45755</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2024-03-20T02:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to color or label ewmachart by different periods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921177#M45777</link>
      <description>&lt;P&gt;&lt;STRONG&gt;You need to provide an ANNOTATE dataset.&lt;/STRONG&gt;&lt;BR /&gt;Can you do that?&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;&lt;SPAN class=" aa-term "&gt;&lt;STRONG&gt;ANNOTATE=&lt;SPAN class=" aa-argument"&gt;SAS-data-set&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=" aa-term "&gt;ANNO=&lt;SPAN class=" aa-argument"&gt;SAS-data-set&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;specifies an input data set that contains appropriate annotate variables, as described in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;SAS/GRAPH: Reference&lt;/EM&gt;. The ANNOTATE= option enables you to add features to the moving average chart (for example, labels that explain out-of-control points). The ANNOTATE= data set is used only when the chart is created as traditional graphics; it is ignored if ODS Graphics is enabled or if you specify the LINEPRINTER option.&lt;BR /&gt;The data set specified with the ANNOTATE= option in the PROC MACONTROL statement is a "global" annotate data set in the sense that the information in this data set is displayed on every chart produced in the current run of the MACONTROL procedure.&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class=" aa-term "&gt;ANNOTATE2=&lt;SPAN class=" aa-argument"&gt;SAS-data-set&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=" aa-term "&gt;ANNO2=&lt;SPAN class=" aa-argument"&gt;SAS-data-set&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;specifies an input data set that contains appropriate annotate variables that add features to the trend chart (secondary chart) produced with the TRENDVAR= option in the EWMACHART or MACHART statement. This option is ignored if ODS Graphics is enabled or if you specify the LINEPRINTER option.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this blog as an example :&lt;BR /&gt;How to show recessions (or other ranges) on a time series plot?&lt;BR /&gt;By Robert Allison on SAS Learning Post August 22, 2014&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2014/08/22/how-to-show-recessions-or-other-ranges-on-a-time-series-plot/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2014/08/22/how-to-show-recessions-or-other-ranges-on-a-time-series-plot/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 19:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921177#M45777</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-03-20T19:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to color or label ewmachart by different periods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921180#M45778</link>
      <description>&lt;P&gt;If you want to see all ANNOTATE posts in the SAS blogs , go here :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/tag/annotate/" target="_blank"&gt;https://blogs.sas.com/content/tag/annotate/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 19:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921180#M45778</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-03-20T19:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to color or label ewmachart by different periods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921288#M45779</link>
      <description>&lt;P&gt;Is there a fully reproducible code for the chart mentioned in the post?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 13:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921288#M45779</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2024-03-21T13:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to color or label ewmachart by different periods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921299#M45780</link>
      <description>&lt;P&gt;SGPLOT?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Sample;
input Sample Diameter Time $;
datalines;
1 24.05 Morning
2 23.99 Morning
3 23.95 Morning
4 23.93 Morning
5 23.97 Morning
6 24.02 Morning
7 24.06 Morning
8 24.10 Morning
9 23.98 Morning
10 24.03 Afternoon
11 23.91 Afternoon
12 24.06 Afternoon
13 24.06 Afternoon
14 23.96 Afternoon
15 23.98 Afternoon
16 24.06 Afternoon
17 24.01 Afternoon
18 24.00 Afternoon
19 23.93 Afternoon
20 23.92 Afternoon
21 24.09 Morning
22 24.11 Morning
23 24.05 Morning
24 23.98 Morning
25 23.98 Morning
26 24.06 Morning
27 24.02 Morning
28 24.06 Morning
29 23.97 Morning
30 23.96 Morning
;

proc MACONTROL data=work.Sample ;
ewmachart Diameter * Sample /
weight = 0.4
sigmas = 3.0
outlimits = c
OUTTABLE=OT
;
label Diameter = "Diameter";
label Sample = "Sample";
run;

data forPlot;
  set OT end=_E_;
  l=0;
  if 10&amp;lt;=Sample&amp;lt;=22 then u=25;
  else u=0;
  output;
run;

proc sgplot data=forPlot noautolegend;
band x=sample lower=_LCLE_ upper=_UCLE_ / transparency=0 modelname="myname";
band x=sample lower=l upper=u / fillattrs=(color=gold transparency=.2);
step x=sample y=_LCLE_ / name="myname" lineattrs=(color=grey thickness=2);
step x=sample y=_UCLE_ / lineattrs=(color=grey thickness=2);
series x=sample y=_MEAN_ / lineattrs=(color=black thickness=2);
series x=sample y=_EWMA_ / lineattrs=(color=blue thickness=3);
yaxis min=23.90 max=24.10;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1711029975658.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94838iFA4D2E56F02CB186/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1711029975658.png" alt="yabwon_0-1711029975658.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 14:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921299#M45780</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-03-21T14:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to color or label ewmachart by different periods?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921300#M45781</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 14:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-color-or-label-ewmachart-by-different-periods/m-p/921300#M45781</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2024-03-21T14:12:52Z</dc:date>
    </item>
  </channel>
</rss>

