spc

cChart

Description

The cChart action produces a c-chart, which is a control chart for the number of nonconformities (defects) in a unit. The input data consists of counts of nonconformities for each subgroup. This chart is used in statistical process control (SPC) to monitor processes where the items being inspected can have multiple defects. The chart helps to determine if the process is in a state of statistical control.

spc.cChart { allN=TRUE | FALSE, chartsTable={...}, display={...}, exChart=TRUE | FALSE, groupByLimit=64-bit-integer, limitN=integer, limitsTable={...}, no3SigmaCheck=TRUE | FALSE, outLimitsTable={...}, outputTables={...}, primaryTests={...}, processName="variable-name", processValue="variable-name", sigmas=double, subgroupN="variable-name", subgroupName="variable-name", subgroupValue="variable-name", table={...}, test2Run=integer, test3Run=integer, testNStd=TRUE | FALSE, testOverlap=TRUE | FALSE };
Settings
ParameterDescription
allNWhen set to True, includes all subgroups regardless of whether the subgroup sample size equals the nominal sample size.
chartsTableSpecifies the charts summary output data table.
displaySpecifies a list of results tables to send to the client for display.
exChartWhen set to True, includes a control chart in the results only when exceptions occur.
groupByLimitSuppresses the analysis if the number of groups exceeds the specified value.
limitNSpecifies a nominal sample size for the control limits.
limitsTableSpecifies the control limits data table.
no3SigmaCheckWhen set to True, enables tests for special causes when the control limits are not three sigma limits.
outLimitsTableSpecifies the output control limits data table.
outputTablesLists the names of results tables to save as CAS tables on the server.
primaryTestsRequests one or more tests for special causes for the primary control chart (Tests 1-8).
processNameSpecifies the variable in the input data table that contains the names of processes to be analyzed.
processValueSpecifies the variable in the input data table that contains the process measurements to be analyzed.
sigmasSpecifies the width of the control limits as a multiple of the standard error of the subgroup summary statistic.
subgroupNSpecifies subgroup sample sizes for attributes charts.
subgroupNameSpecifies the variable in the input data table that contains the names of subgroup variables.
subgroupValueSpecifies the variable in the input data table that contains the subgroup values.
tableSpecifies the input data table for the analysis.
test2RunSpecifies the length of the pattern for Test 2 (default is 9).
test3RunSpecifies the length of the pattern for Test 3 (default is 6).
testNStdWhen set to True, enables tests for special causes with varying subgroup sample sizes.
testOverlapWhen set to True, applies tests for special causes to overlapping patterns of points.
Data Preparation View data prep sheet
Data Creation: Circuit Board Defects

This SAS code creates a sample dataset named 'Circuits'. Each record represents a batch of circuit boards inspected on a specific date, with 'Defects' indicating the number of nonconformities found.

Copied!
1DATA mycas.Circuits;
2INPUT Date date9. Defects @@;
3FORMAT Date date9.;
4DATALINES;
505MAR2023 12 06MAR2023 15 07MAR2023 19 08MAR2023 14 09MAR2023 11
610MAR2023 10 11MAR2023 16 12MAR2023 18 13MAR2023 21 14MAR2023 13
715MAR2023 17 16MAR2023 12 17MAR2023 25 18MAR2023 16 19MAR2023 14
820MAR2023 15 21MAR2023 18 22MAR2023 12 23MAR2023 11 24MAR2023 10
9;
10RUN;

Examples

This example generates a standard c-chart for the number of defects per batch, using the 'Date' as the subgroup identifier.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 spc.cChart /
3 TABLE={name='Circuits'},
4 processValue='Defects',
5 subgroupValue='Date';
6RUN;
Result :
The action will produce a c-chart, displaying the number of defects for each date. It will show the central line (average number of defects), and the upper and lower control limits (UCL and LCL) calculated from the data.

This example demonstrates a more advanced use case. It uses a separate table 'mycas.myLimits' to define the control limits instead of calculating them from the data. It also enables several tests (1, 2, and 3) to detect specific patterns that indicate special causes of variation in the process. The results, including the chart data, are saved to a new CAS table named 'CChartSummary'.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 spc.cChart /
3 TABLE={name='Circuits'},
4 processValue='Defects',
5 subgroupValue='Date',
6 limitsTable={name='mycas.myLimits'},
7 primaryTests={test1=true, test2=true, test3=true},
8 chartsTable={name='CChartSummary', replace=true};
9RUN;
Result :
A c-chart is generated using the control limits from 'mycas.myLimits'. Any points that fail Tests 1, 2, or 3 (e.g., a point outside the limits, a run of 9 points on one side of the center line) will be flagged. The summary data for the chart is stored in the 'mycas.CChartSummary' table for further analysis or reporting.

FAQ

What is the purpose of the cChart action in SAS Viya?
What does the `allN` parameter do in the cChart action?
How can I specify an output table for the chart's summary data?
What is the function of the `exChart` parameter?
How do I define a nominal sample size for the control limits?
What are the `primaryTests` used for in the cChart action?
What specific condition does `test1` check for?
What pattern is identified by `test2`?
How does the `sigmas` parameter affect the control limits?
Can I run tests for special causes if my control limits are not 3-sigma?
What is the primary purpose of the cChart action?
What is the mandatory parameter for using the cChart action?
How can I test for special causes, like a point outside the control limits?
What does the 'sigmas' parameter do?
Is it possible to save the calculated control limits for later use?
How does the action handle subgroups with varying sample sizes?