spc boxChart

Standard Case: Manufacturing Process Capability Analysis

Scénario de test & Cas d'usage

Business Context

A manufacturing plant produces high-precision engine pistons. The engineering team needs to monitor the diameter of the pistons from a specific production line (Line A) to ensure the process is stable and capable of meeting strict design specifications. They want to identify any special causes of variation and calculate process capability indices (Cpk, Ppk).
About the Set : spc

Statistical Process Control (control charts).

Discover all actions of spc
Data Preparation

Create two CAS tables: 'PistonDiameters' with diameter measurements from 25 subgroups (batches), and 'PistonSpecs' containing the engineering specification limits for the diameter.

Copied!
1DATA mycas.PistonDiameters;
2 DO Batch = 1 to 25;
3 DO i = 1 to 10;
4 /* Introduce a slight upward trend and one outlier */
5 IF Batch = 18 THEN Diameter = 100.15 + 0.08 * rannor(5678);
6 ELSE Diameter = 100.0 + (Batch * 0.001) + 0.05 * rannor(1234);
7 OUTPUT;
8 END;
9 END;
10RUN;
11 
12DATA mycas.PistonSpecs;
13 LENGTH _VAR_ $ 32;
14 _VAR_ = 'Diameter';
15 _LSL_ = 99.85;
16 _USL_ = 100.15;
17 _TARGET_ = 100.0;
18RUN;

Étapes de réalisation

1
Load the spc action set. This is a prerequisite.
Copied!
1 
2PROC CAS;
3actionset.LOADACTIONSET / actionSet='spc';
4RUN;
5 
2
Run the boxChart action to generate control limits, apply special cause tests (Test 1 for outliers, Test 3 for trends), and calculate capability indices using the specification limits table. Save the control limits and the chart summary data.
Copied!
1PROC CAS;
2 spc.boxChart /
3 TABLE={name='PistonDiameters'},
4 processValue='Diameter',
5 subgroupValue='Batch',
6 specsTable={name='PistonSpecs'},
7 primaryTests={test1=true, test3={RUN=6}},
8 outLimitsTable={name='PistonLimits_01', replace=true},
9 chartsTable={name='ChartSummary_01', replace=true},
10 outputTables={names={capability='CapabilityIndices_01'}};
11RUN;
3
Verify the output tables. Check the 'PistonLimits_01' table for the calculated control limits. Check the 'ChartSummary_01' table for subgroup statistics and any test failures. Check the 'CapabilityIndices_01' for Cpk values.
Copied!
1PROC CAS;
2 TABLE.fetch / TABLE={name='PistonLimits_01'};
3 TABLE.fetch / TABLE={name='ChartSummary_01'} where='_TESTS_ ne ""';
4 TABLE.fetch / TABLE={name='CapabilityIndices_01'};
5RUN;

Expected Result


The action should execute successfully. The 'ChartSummary_01' table should flag Batch 18 for failing Test 1 (outlier) and potentially flag a sequence of points for failing Test 3 (trend). The 'CapabilityIndices_01' table should contain calculated capability metrics like Cpk, which will likely be poor due to the process instability shown by the failed tests. The 'PistonLimits_01' table will contain the sigma-based limits for the process.