Desktop productivity for business analysts and programmers

Displaying Multiple Sets of Control Limits

Reply
Contributor
Posts: 23

Displaying Multiple Sets of Control Limits

Hello,

I see this has been asked once before (http://support.sas.com/forums/thread.jspa?messageID=39554骂). However I'm trying to better understand the capabilities of the READPHASES and READINDEXES options.

My reference is this documentation article;
http://support.sas.com/documentation/cdl/en/qcug/63922/HTML/default/viewer.htm#qcug_shewhart_a000000...

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.

Sincerely,
John
Contributor Jay
Contributor
Posts: 24

Re: Displaying Multiple Sets of Control Limits

I tried to find an old application where I did this and got close, found the code but not the data but,... I think the options that will help you out with this is the "by variable" i.e. "by process".

When you create your outlimits dataset use "by process" this will add the name of the process to the limits dataset.

Then when you create the display of the chart using the limits dataset, use the "by process" again and it will match the display dataset with the correct limits dataset.
Contributor
Posts: 23

Re: Displaying Multiple Sets of Control Limits

Thank you Jay,

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.

John
Contributor
Posts: 23

Re: Displaying Multiple Sets of Control Limits

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 Smiley Tonguelant & 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;
;
%_eg_conditional_dropds(WORK.Flange2);
proc shewhart data=Flange ; /* 1-2 create the limits table*/
xchart FlwidthX*Sample /
nochart
OUTLIMITS=testlimits
;
BY Plant Machine _phase_;
run;
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_;
;
%_eg_conditional_dropds(WORK.testlimits);
/**
** Step 2: Create the XChart with multiple limits
**/
PROC SORT DATA=WORK.FLANGE /* 2-1 Re-sort the data table */
OUT=WORK.FLANGE3
;
BY Plant Machine Sample;
RUN;
%_eg_conditional_dropds(WORK.FLANGE);
proc shewhart data=Flange3 limits=testlimits2; /* 2-2 Create charts */
xchart FlwidthX*Sample /
readphase = all
readindex = all
;
BY Plant Machine;
run;
%_eg_conditional_dropds(WORK.Flange3);
%_eg_conditional_dropds(WORK.testlimits2);

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.

John
Ask a Question
Discussion stats
  • 3 replies
  • 169 views
  • 0 likes
  • 2 in conversation