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 upper X overbar 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

The SPC Procedure

Means Chart Summary for RANDOM
processnamesubgroupnameNumber of
Subgroups
Number
> UCL
Number
< LCL
Test 1
Signals
Test 2
Signals
Test 3
Signals
Test 4
Signals
Process006Subgroup00630011000
Process011Subgroup01130101010
Process015Subgroup01530011000
Process021Subgroup02130101000
Process031Subgroup03130000100
Process032Subgroup03230101000
Process034Subgroup03430000010
Process047Subgroup04730000020
Process048Subgroup04830000001
Process066Subgroup06630000001
Process069Subgroup06930000010
Process074Subgroup07430000001
Process078Subgroup07830011000
Process079Subgroup07930000010
Process080Subgroup08030011000
Process081Subgroup08130000010
Process089Subgroup08930101000
Process092Subgroup09230101000
Process099Subgroup09930000010


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.

Last updated: September 22, 2026