SPC Procedure
Example 32.4 Applying Tests for Special Causes
(View the complete code for this example.)
The following statements produce a data table for 100 simulated process measurements, called Process001 through Process100:
data mylib.Random;
length processname $16 subgroupname $16;
do i = 1 to 100;
processname = 'Process' || left( put( i, z3. ) );
subgroupname = 'Subgroup' || left( put( i, z3. ) );
do subgroup = 1 to 30;
do j = 1 to 5;
process = rannor(123);
output;
end;
end;
end;
drop i j;
run;
The following statements use PROC SPC to do an chart analysis of the simulated data and apply the first through fourth tests for special causes:
proc spc data=mylib.Random;
xchart / exchart
tests = 1 to 4
outtable = mylib.RandomTests;
run;
The TESTS= option requests the tests for special causes. Figure 2 shows the resulting exception summary table.
Output 32.4.1: Results of Tests for Special Causes
| Means Chart Summary for RANDOM | ||||||||
|---|---|---|---|---|---|---|---|---|
| processname | subgroupname | Number of Subgroups | Number > UCL | Number < LCL | Test 1 Signals | Test 2 Signals | Test 3 Signals | Test 4 Signals |
| Process006 | Subgroup006 | 30 | 0 | 1 | 1 | 0 | 0 | 0 |
| Process011 | Subgroup011 | 30 | 1 | 0 | 1 | 0 | 1 | 0 |
| Process015 | Subgroup015 | 30 | 0 | 1 | 1 | 0 | 0 | 0 |
| Process021 | Subgroup021 | 30 | 1 | 0 | 1 | 0 | 0 | 0 |
| Process031 | Subgroup031 | 30 | 0 | 0 | 0 | 1 | 0 | 0 |
| Process032 | Subgroup032 | 30 | 1 | 0 | 1 | 0 | 0 | 0 |
| Process034 | Subgroup034 | 30 | 0 | 0 | 0 | 0 | 1 | 0 |
| Process047 | Subgroup047 | 30 | 0 | 0 | 0 | 0 | 2 | 0 |
| Process048 | Subgroup048 | 30 | 0 | 0 | 0 | 0 | 0 | 1 |
| Process066 | Subgroup066 | 30 | 0 | 0 | 0 | 0 | 0 | 1 |
| Process069 | Subgroup069 | 30 | 0 | 0 | 0 | 0 | 1 | 0 |
| Process074 | Subgroup074 | 30 | 0 | 0 | 0 | 0 | 0 | 1 |
| Process078 | Subgroup078 | 30 | 0 | 1 | 1 | 0 | 0 | 0 |
| Process079 | Subgroup079 | 30 | 0 | 0 | 0 | 0 | 1 | 0 |
| Process080 | Subgroup080 | 30 | 0 | 1 | 1 | 0 | 0 | 0 |
| Process081 | Subgroup081 | 30 | 0 | 0 | 0 | 0 | 1 | 0 |
| Process089 | Subgroup089 | 30 | 1 | 0 | 1 | 0 | 0 | 0 |
| Process092 | Subgroup092 | 30 | 1 | 0 | 1 | 0 | 0 | 0 |
| Process099 | Subgroup099 | 30 | 0 | 0 | 0 | 0 | 1 | 0 |
Nineteen of the 100 processes are flagged for at least one exception: a subgroup mean outside the control limits or a positive test result. Because these data were simulated from a normal distribution, they represent processes that are in statistical control. Therefore, you should regard all these exceptions as false positives.
The combined chance of a false signal when Tests 1–4 are applied together is less than 1 in 100 (see the section Interpreting Tests for Special Causes). Therefore, finding 21 positive tests in an analysis of 3,000 total subgroups is not unexpected.