My understanding is that with the combinations of these two options one can generate a control chart with multiple sets of limits, only if the limits are provided.
Am I correct in my understanding that in order to provide those limits one must follow these steps?
1) create the chart with no phases
2) recognise the opportunity to phase the chart
3) chart the different phases and output the limits with the OUTLIMITS option
4) combine those output tables into one table
5) chart the final result with multiple sets of limits
I'm hoping that I am missing an option that will read the phases, calulate and display the different limits per phase. My current understanding seems counter productive especially when one is dealing with many charts of different processes. I have a Excel file that calculates the limits of the different phases that are identified. So it seems likely that SAS/QC could/should be as capable.
Thanks in advance for any clarification or assistance.
It's good to know that it's not just my interpretation of this functionality. I plan on starting the coding next week so I'll look at the "by variable" option.
As an aside I'm not sure why this capability has been forced on the users by SAS. In my mind there is only risk and no benefit for the user in performing these step to get the desired results. This should be available as an option in SAS in the future.
Here is the code I used to create charts with multiple limits.
It first requires some sample data. I started with the sample data set Flange and added in two columns lant & Machine. These represent the different processes I require in my code. I then replicated the existing 30 observations to create four distinct sets of results;
Plant: ABC, Machine: Red
Plant: ABC, Machine: Blue
Plant: XYZ, Machine: Red
Plant: XYZ, Machine: Blue
I then varied the FlwidthX values by a random value in three of the four sets to ensure I was getting 4 sets of limits.
**Step 1: Create Limits by Plant, Machine and _phase_
PROC SQL; /* 1-1 sort data by different charts and phase */
Create Table Flange AS
Select t1.Plant, t1.Machine, t1._phase_, t1.Day, t1.Sample, t1.FlwidthX, t1.FlwidthN
From Flange2 as t1
Order by Plant, Machine, _phase_, Sample;
proc shewhart data=Flange ; /* 1-2 create the limits table*/
xchart FlwidthX*Sample /
BY Plant Machine _phase_;
PROC SQL; /* 1-3 re-label the limits table */
Create table testlimits2 AS
Select t1.Plant, t1.Machine, t1._phase_ as _index_
, t1._VAR_, t1._SUBGRP_, t1._TYPE_, t1._LIMITN_
, t1._ALPHA_, t1._SIGMAS_, t1._LCLX_, t1._MEAN_
, t1._UCLX_, t1._LCLR_, t1._R_, t1._UCLR_, t1._STDDEV_
From testlimits as t1
Order by t1.Plant, t1.Machine, _index_, t1._SUBGRP_;
** Step 2: Create the XChart with multiple limits
PROC SORT DATA=WORK.FLANGE /* 2-1 Re-sort the data table */
BY Plant Machine Sample;
proc shewhart data=Flange3 limits=testlimits2; /* 2-2 Create charts */
xchart FlwidthX*Sample /
readphase = all
readindex = all
BY Plant Machine;
I will never get the last 3 hours of my life back writing something so convoluted that should be a fundamental option within the SHEWHART procedures.