SPC Procedure
Dictionary of Options
The following entries provide detailed descriptions of options that are available in the BOXCHART, CCHART, EWMACHART, IRCHART, MACHART, MCHART, MRCHART, NPCHART, PCHART, RCHART, SCHART, UCHART, XCHART, XRCHART, and XSCHART statements. An option is available in all the chart statements unless otherwise noted.
- ALLN
includes all subgroups in the analysis, regardless of whether the subgroup sample size equals the nominal control limit sample size n that you specify in the LIMITN= option or the variable
_LIMITN_in the LIMITS= data table. Use the ALLN option in conjunction with the LIMITN= option or the variable_LIMITN_.- ASYMPTOTIC
-
requests constant lower and upper control limits for all subgroups in a moving average chart.
In a uniformly weighted moving average chart, asymptotic limits have the following values:
Here w is the span of the moving average, and n is the nominal sample size associated with the control limits. When you do not specify this option, the control limits are computed using the exact formulas in Table 25.
In an exponentially weighted moving average chart, asymptotic limits have the following values:
Here r is the weight parameter
, and n is the nominal sample size associated with the control limits. When you do not specify the ASYMPTOTIC option, the control limits are computed using the exact formulas in Table 26.
Use the ASYMPTOTIC option only if all the subgroup sample sizes are the same or if you specify a nominal subgroup sample size by using the LIMITN= option or by including the
_LIMITN_column in a LIMITS= data table.This option is available only in the EWMACHART and MACHART statements.
- CIINDICES <(<TYPE=LOWER | UPPER | TWOSIDED> <ALPHA=value>)>
-
requests capability index confidence limits that are based on subgroup summary data and are calculated using "effective degrees of freedom," as described by Bissell (1990). These confidence limits are approximate. When you specify the CIINDICES option, the calculated confidence limits are displayed in the "CapabilityIndices" table and are included in the OUTLIMITS= data table, if one is produced.
- TYPE=keyword
specifies the type of confidence limit. Valid keywords are LOWER, UPPER, and TWOSIDED. By default, TYPE=TWOSIDED.
- ALPHA=value
specifies the default confidence level to compute confidence limits. The percentage for the confidence limits is
. For example, ALPHA=.05 results in a 95% confidence limit. The default value is .05, and the possible range of values is from 0 to 1.
The CIINDICES option is ignored unless you also specify the SPECS= option. These options are available only in the chart statements that produce Shewhart charts for variables: BOXCHART, IRCHART, MCHART, MRCHART, RCHART, SCHART, XCHART, XRCHART, and XSCHART. For more information about capability indices, see the section Capability Indices.
- CONTROLSTAT=MEAN | MEDIAN
specifies whether the control limits that are displayed in a box chart are computed for subgroup means or for subgroup medians. By default, CONTROLSTAT=MEAN. This option is available only in the BOXCHART statement.
- EXCHART
includes a control chart in the results only when exceptions occur—specifically, when the control limits are exceeded or when any tests that you request by using the TESTS= or TESTS2= option are positive.
- LIMITN=n
-
specifies a nominal sample size for the control limits, where n is a whole number.
If you specify LIMITN=n, the control limits are computed for the fixed value n, and they do not vary with the subgroup sample sizes. Moreover, only those subgroups whose sample size is equal to n are included in the analysis. You can specify the ALLN option in conjunction with LIMITN=n to force all subgroups to be included, regardless of subgroup sample size.
Note that control limits for EWMA and moving average charts vary according to the number of subgroup means that are included in the moving average, not only because of varying subgroup sample sizes.
If you do not specify LIMITN=n and the subgroup sample sizes are constant, the default value of n is the constant subgroup sample size.
Depending on which chart statement you use, there are restrictions on the value of n that you can specify in the LIMITN= option:
For the EWMACHART, MACHART, SCHART, and XSCHART statements,
.
For the BOXCHART, MCHART, and XCHART statements,
. If the estimate of the process standard deviation is based on subgroup ranges (see the SMETHOD= option and the section Methods of Estimating the Standard Deviation),
.
This option is not available in the IRCHART statement.
Notice the difference between the LIMITN= option and the SUBGROUPN= option that is available in the CCHART, NPCHART, PCHART, and UCHART statements. The LIMITN= option specifies a nominal sample size for the control limits, whereas the SUBGROUPN= option provides the sample sizes for the data.
Note: As an alternative to specifying the LIMITN= option, you can read the nominal control limit sample size from the variable
_LIMITN_in a LIMITS= data table. - MEDCENTRAL=AVGMEAN | AVGMED | MEDMED
-
identifies a method of estimating the process mean
, which is represented by the central line on a median chart. The method that corresponds to each keyword is shown in Table 16.
Table 16: Methods of Estimating the Process Mean
Keyword Method AVGMEAN Average of subgroup means AVGMED Average of subgroup medians MEDMED Median of subgroup medians
By default, MEDCENTRAL=AVGMED. This option is available only in the MCHART and MRCHART statements, and in the BOXCHART statement when you specify the CONTROLSTAT=MEDIAN option.
- NO3SIGMACHECK
-
suppresses the check for
limits when you request tests for special causes. This enables tests for special causes to be applied when you use SIGMAS= option to specify control limits other than the default
limits. You should not use the NO3SIGMACHECK option for standard control chart applications, because the standard tests for special causes assume
limits.
This option is not available in the EWMACHART and MACHART statements.
- NOPRINT
- OUTLIMITS=libref.data-table
-
creates an output data table that saves the control limits and/or control limit parameters. You can use an OUTLIMITS= data table as an input LIMITS= data table in a subsequent run of the procedure. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using SAS Viya Workbench.
For more information about OUTLIMITS= data tables, see the section OUTLIMITS= Data Table.
- OUTTABLE=libref.data-table
-
creates an output data table that saves the information plotted on the chart, including the subgroup variable values and their corresponding summary statistics and control limits. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using SAS Viya Workbench.
For more information about OUTTABLE= data tables, see the section OUTTABLE= Data Table.
- PCTLDEF=index
specifies one of five definitions that are used to calculate percentiles in the construction of box-and-whisker plots that you request in the BOXCHART statement. The index can be 1, 2, 3, 4, or 5. The five corresponding percentile definitions are discussed in the section Percentile Definitions. By default, PCTLDEF=5. This option is available only in the BOXCHART statement.
- RESET
resets the value of the EWMA after each out-of-control point. Specifically, when a point exceeds the control limits, the EWMA for the next subgroup is computed as the weighted average of the subgroup mean and the overall mean. By default, the EWMA values are not reset. This option is available only in the EWMACHART statement.
- SIGMAS=k
specifies the width of the control limits in terms of the multiple k of the standard error of the subgroup summary statistic. The value of k must be positive. By default, k = 3, and the control limits are
limits.
- SMETHOD=MAD | MMR<(n)> | MVGRANGE<(n)> | RMSDF | RMVLUE | RNOWEIGHT | SMVLUE | SNOWEIGHT
-
specifies the method of estimating the process standard deviation,
, as summarized in Table 17.
Table 17: Methods of Estimating the Process Standard Deviation
Table 18 lists the SMETHOD= option values that are valid for each chart statement. The default value for each statement is shown in bold.
Table 18: Valid SMETHOD= Values by Chart Statement
Chart Statement Methods BOXCHART RMSDF, RMVLUE, RNOWEIGHT, SMVLUE, SNOWEIGHT EWMACHART RMSDF, SMVLUE, SNOWEIGHT IRCHART MAD, MMR, MVGRANGE MACHART RMSDF, SMVLUE, SNOWEIGHT MCHART RMSDF, RMVLUE, RNOWEIGHT, SMVLUE, SNOWEIGHT MRCHART RMVLUE, RNOWEIGHT RCHART RMVLUE, RNOWEIGHT SCHART RMSDF, SMVLUE, SNOWEIGHT XCHART RMSDF, RMVLUE, RNOWEIGHT, SMVLUE, SNOWEIGHT XRCHART MVGRANGE, RMVLUE, RNOWEIGHT XSCHART MVGRANGE, RMSDF, SMVLUE, SNOWEIGHT
When you use the MMR or MVGRANGE method, you can specify the number n of consecutive subgroup summary statistics from which moving ranges are computed by appending the number in parentheses to the keyword. For example, you can specify SMETHOD=MVGRANGE(4) to use moving ranges of four subgroup statistics. Values in the range
are valid. By default,
.
This option is not available in the following statements that produce Shewhart charts for attributes: CCHART, NPCHART, PCHART, and UCHART.
For more information about the different methods of estimating the process standard deviation, see the section Methods of Estimating the Standard Deviation.
- SPAN=w
-
specifies the number of terms to use in calculating the moving average for a uniformly weighted moving average chart, where w is an integer greater than 1. This option is required in an MACHART statement unless you specify span values in a column named
_SPAN_in a LIMITS= data table.This option is available only in the MACHART statement.
- SPECS=libref.data-table
-
specifies an input data table that contains process specification limits. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the input data table. For more information about this two-level name, see the DATA= option and the section Using SAS Viya Workbench. PROC SPC calculates capability indices for processes whose specifications are given in data-table.
This option is available only in the statements that produce Shewhart charts for variables: BOXCHART, IRCHART, MCHART, MRCHART, RCHART, SCHART, XCHART, XRCHART, and XSCHART. For more information, see the sections SPECS= Data Table and Capability Indices.
- SUBGROUPN=variable
specifies a variable in the input data table whose values specify the subgroup sample sizes. This option is available only in the CCHART, NPCHART, PCHART, and UCHART statements. You must specify this option in the NPCHART, PCHART, and UCHART statements. For the CCHART statement, the default subgroup sample size is 1.
- TEST2RUN=run-length
-
specifies the length of the pattern for Test 2 that you request in the TESTS= and TESTS2= options. The run-length values that you can specify are 7, 8, 9, 11, 14, and 20. The form of the test for each run-length value is shown in the following table. By default, TEST2RUN=9. For more information, see the section Tests for Special Causes.
Number of Points on One run-length Side of the Central Line 7 7 in a row 8 8 in a row 9 9 in a row 11 At least 10 out of 11 in a row 14 At least 12 out of 14 in a row 20 At least 16 out of 20 in a row This option is not available in the EWMACHART and MACHART statements.
- TEST3RUN=run-length
-
specifies the length of the pattern for Test 3 that you request in the TESTS= and TESTS2= options. Test 3 searches for a pattern of steadily increasing or decreasing values, where the length of the pattern is at least the value of run-length. The values that you can specify for run-length are 6, 7, and 8. By default, TEST3RUN=6. For more information, see the section Tests for Special Causes.
This option is not available in the EWMACHART and MACHART statements.
- TESTNSTD
-
applies the tests for special causes that you request in the TESTS= and TESTS2= options to standardized test statistics when the subgroup sample sizes are not constant. This method was suggested by Nelson (1994). For more information, see the section Tests for Special Causes. By default, the tests are not applied to data that have varying subgroup sample sizes.
This option is not available in the EWMACHART and MACHART statements.
- TESTOVERLAP
-
applies tests for special causes (which you request in the TESTS= or TESTS2= option) to overlapping patterns of points.
This option modifies the way in which the search for a subsequent pattern is done when a pattern is encountered. If you omit this option, the search begins with the first subgroup after the current pattern ends. If you specify this option, the search begins with the second subgroup in the current pattern.
The following statements request Test 3, which detects six subgroup means in a row that steadily increase or decrease:
proc spc; xrchart / test=3; xrchart / test=3 testoverlap; run;Suppose that the subgroup means are steadily increasing for subgroups 5, 6, 7, 8, 9, 10, and 11. The first XRCHART statement signals that Test 3 is positive at subgroup 10 but not at subgroup 11, because the search for the next pattern begins with subgroup 11. The second XRCHART statement signals that Test 3 is positive at subgroup 10 and subgroup 11, because the search for the next pattern begins with subgroup 6 and thus finds a second pattern that ends with subgroup 11. For more information, see the section Tests for Special Causes.
Caution: Specifying TESTOVERLAP affects the interpretation of the standard tests for special causes, because a particular point can contribute to more than one positive test. Typically, you should not use this option.
This option is not available in the EWMACHART and MACHART statements.
- TESTS=index-list
-
requests one or more tests for special causes, which are also known as runs tests, pattern tests, and Western Electric rules. These tests detect particular nonrandom patterns in the points that are plotted on the primary control chart. The occurrence of a pattern, referred to as a signal, suggests the presence of a special cause of variation.
Each pattern is defined in terms of Zones A, B, and C, which are constructed by dividing the interval between the control limits into six equally spaced subintervals. Zone A is the union of the subintervals immediately below the upper control limit and immediately above the lower control limit. Zone C is the union of the subintervals immediately above and below the central line. Zone B is the union of the subintervals between Zones A and C. For an illustration of test zones, see Figure 9.
Table 19 lists the standard tests that you can request by specifying this option. The tests are indexed according to the sequence used by Nelson (1984, 1985).
Table 19: Standard Tests for Special Causes
Index Pattern Description 1 One point beyond Zone A (outside the control limits) 2 Nine points in a row in Zone C or beyond on one side of the central line (see the TEST2RUN= option) 3 Six points in a row that steadily increase or decrease (see the TEST3RUN= option) 4 Fourteen points in a row that alternate up and down 5 Two out of three points in a row in Zone A or beyond 6 Four out of five points in a row in Zone B or beyond 7 Fifteen points in a row in Zone C on either or both sides of the central line 8 Eight points in a row on either or both sides of the central line, with no points in Zone C
You can specify any combination of the eight indices by using an explicit list or an implicit list, as in the following example:
proc spc; xrchart / tests=1 2 3 4; xrchart / tests=1 to 4; run;The TESTS= option is available in all chart statements except the RCHART and SCHART statements. Use only tests 1, 2, 3, and 4 in the CCHART, NPCHART, PCHART, and UCHART statements. By default, the TESTS= option is not applied in any chart statement unless the control limits are
limits. You can use the NO3SIGMACHECK option to request tests for special causes when you use the SIGMAS= option to specify control limits other than
limits.
For more information about the TESTS= option, see the section Tests for Special Causes. Related options include TEST2RUN=, TEST3RUN=, TESTNSTD, TESTOVERLAP, and TESTS2=.
This option is not available in the EWMACHART and MACHART statements.
- TESTS2=index-list
requests one or more tests for special causes for R charts or s charts. The syntax for the TESTS2= option is identical to the syntax for the TESTS= option. The TESTS2= option is available in the MRCHART, RCHART, SCHART, XRCHART, and XSCHART statements. For more information about the TESTS2= option, see the section Tests for Special Causes. Related options include TEST2RUN=, TEST3RUN=, TESTNSTD, TESTOVERLAP, and TESTS=.
- WEIGHT=r
-
specifies the weight r (
) assigned to the most recent subgroup mean in the computation of the exponentially weighted moving average in an EWMA chart. The WEIGHT= option is required in an EWMACHART statement unless you specify weight values in a column named
_WEIGHT_in a LIMITS= data table.This option is available only in the EWMACHART statement.