<?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: PROC SHEWHART tests for special causes aka  westgard rules in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709954#M34374</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;.&amp;nbsp; Indeed, Testoverlap does solve the first problem.&amp;nbsp; It extends the trend so that the full trend is highlighted.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still wish there was a way to make the output data to flag the samples at the beginning of the trend (i.e. samples 14-17).&amp;nbsp; But since I know the number of number of samples in the trend rule, it shouldn't be that bad for me to count back to the beginning of the trend. And probably better than counting my own trends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc shewhart history=Assembly;
xrchart Offset * Sample / 
  nochart2
  outtable=ShewResults
  mu0 = 20
  sigma0 = 2.24
  limitn = 5
  alln
  tests = 3
  &lt;STRONG&gt;testoverlap&lt;/STRONG&gt;
  vaxis = 16 to 26 by 2
  split = '/';
  label OffsetX = 'Avg Offset in cm/Range' 
;
run;


Sample    _SUBX_    _TESTS_

   1       19.80
   2       17.16
   3       20.11
   4       20.89
   5       20.83
   6       18.87
   7       20.84
   8       23.33
   9       19.21
  10       20.48
  11       22.05
  12       20.02
  13       17.58
  14       19.11
  15       20.03
  16       20.56
  17       20.86
  18       21.10       3
  19       21.50       3
  20       21.76       3
  21       21.76
  22       20.54
  23       20.04
  24       19.94
  25       20.70
  26       21.40
  27       21.32
  28       20.03
  29       22.02
  30       21.32
&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Jan 2021 17:05:33 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2021-01-07T17:05:33Z</dc:date>
    <item>
      <title>PROC SHEWHART tests for special causes aka  westgard rules</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709936#M34372</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm a fan of PROC SHEWHART, but I've never liked how it highlights trends, so I usually end up coding my own trend detection.&amp;nbsp; Wondering if I'm missing something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below data and code is from SAS/QC docs.&amp;nbsp; I modified the data so that instead of a trend of 5 increasing values, there is a trend of 7 increasing values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Assembly;
  length System $ 1 comment $ 16;
  label Sample = 'Sample Number';
  input System Sample OffsetX OffsetR OffsetN comment $16. ;
  if sample=19 then offsetX=21.5; *make a trend of 7 increasing, sample 14-20;
datalines;
T 1 19.80 3.8 5
T 2 17.16 8.3 5
T 3 20.11 6.7 5
T 4 20.89 5.5 5
T 5 20.83 2.3 5
T 6 18.87 2.6 5
T 7 20.84 2.3 5
T 8 23.33 5.7 5 New Tool
T 9 19.21 3.5 5
T 10 20.48 3.2 5
T 11 22.05 4.7 5
T 12 20.02 6.7 5
T 13 17.58 2.0 5
T 14 19.11 5.7 5
T 15 20.03 4.1 5
R 16 20.56 3.7 5 Changed System
R 17 20.86 3.3 5
R 18 21.10 5.6 5 Reset Tool
R 19 19.05 2.7 5
R 20 21.76 2.8 5
R 21 21.76 6.4 5
R 22 20.54 4.8 5
R 23 20.04 8.2 5
R 24 19.94 8.8 5
R 25 20.70 5.1 5
Q 26 21.40 12.1 7 Bad Reading
Q 27 21.32 3.2 7
Q 28 20.03 5.2 7 New Gauge
Q 29 22.02 5.9 7
Q 30 21.32 4.3 7
;



title 'Analysis of Assembly Data';
proc shewhart history=Assembly;
xrchart Offset * Sample / 
  nochart2
  outtable=ShewResults
  mu0 = 20
  sigma0 = 2.24
  limitn = 5
  alln
  tests = 3
  vaxis = 16 to 26 by 2
  split = '/';
  label OffsetX = 'Avg Offset in cm/Range'
;
run;

proc print data=shewresults;
  var sample _subx_ _tests_;
run;&lt;BR /&gt;title2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Two things about the trend detection bother me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. There is a trend of 7 increasing values, but only the first 5 are highlighted in the chart.&amp;nbsp; If the trend continues beyond the limit, I would think the whole trend should be highlighted.&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="SPC.PNG" style="width: 997px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53280iA50C2646B5219E67/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPC.PNG" alt="SPC.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2. The output dataset ShewResults flags trends, but it only flags the one subgroup where the trend of 5 increasing in a row was detected (Sample 18).&amp;nbsp; It would be much more useful if it flagged Sample 14-17 as well, and also 19-20.&amp;nbsp; That is, I think it would be better if the _TESTS_ variable flagged all subgroups that are part of the trend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sample    _SUBX_    _TESTS_

   1       19.80
   2       17.16
   3       20.11
   4       20.89
   5       20.83
   6       18.87
   7       20.84
   8       23.33
   9       19.21
  10       20.48
  11       22.05
  12       20.02
  13       17.58
  14       19.11
  15       20.03
  16       20.56
  17       20.86
  18       21.10       3
  19       21.50
  20       21.76
  21       21.76
  22       20.54
  23       20.04
  24       19.94
  25       20.70
  26       21.40
  27       21.32
  28       20.03
  29       22.02
  30       21.32
&lt;/PRE&gt;
&lt;P&gt;Because of these limitations, I usually just code my own trend detection.&amp;nbsp; But before I do that again, wanted to make sure I'm not missing an easy way to get what I want from directly out of Shewhart.&amp;nbsp; &amp;nbsp;Mostly want I want is an output dataset , with the subgroups 14-20 flagged for being part of a trend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;--Q.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 15:47:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709936#M34372</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-01-07T15:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SHEWHART tests for special causes aka  westgard rules</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709939#M34373</link>
      <description>&lt;P&gt;I think the TESTOVERLAP option does what you want.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 15:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709939#M34373</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-07T15:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SHEWHART tests for special causes aka  westgard rules</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709954#M34374</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;.&amp;nbsp; Indeed, Testoverlap does solve the first problem.&amp;nbsp; It extends the trend so that the full trend is highlighted.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still wish there was a way to make the output data to flag the samples at the beginning of the trend (i.e. samples 14-17).&amp;nbsp; But since I know the number of number of samples in the trend rule, it shouldn't be that bad for me to count back to the beginning of the trend. And probably better than counting my own trends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc shewhart history=Assembly;
xrchart Offset * Sample / 
  nochart2
  outtable=ShewResults
  mu0 = 20
  sigma0 = 2.24
  limitn = 5
  alln
  tests = 3
  &lt;STRONG&gt;testoverlap&lt;/STRONG&gt;
  vaxis = 16 to 26 by 2
  split = '/';
  label OffsetX = 'Avg Offset in cm/Range' 
;
run;


Sample    _SUBX_    _TESTS_

   1       19.80
   2       17.16
   3       20.11
   4       20.89
   5       20.83
   6       18.87
   7       20.84
   8       23.33
   9       19.21
  10       20.48
  11       22.05
  12       20.02
  13       17.58
  14       19.11
  15       20.03
  16       20.56
  17       20.86
  18       21.10       3
  19       21.50       3
  20       21.76       3
  21       21.76
  22       20.54
  23       20.04
  24       19.94
  25       20.70
  26       21.40
  27       21.32
  28       20.03
  29       22.02
  30       21.32
&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jan 2021 17:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-SHEWHART-tests-for-special-causes-aka-westgard-rules/m-p/709954#M34374</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-01-07T17:05:33Z</dc:date>
    </item>
  </channel>
</rss>

