MACHART Statement: MACONTROL Procedure

Input Data Sets

DATA= Data Set

You can read raw data (process measurements) from a DATA= data set specified in the PROC MACONTROL statement. Each process specified in the MACHART statement must be a SAS variable in the DATA= data set. This variable provides measurements that must be grouped into subgroup samples indexed by the subgroup-variable. The subgroup-variable, which is specified in the MACHART statement, must also be a SAS variable in the DATA= data set. Each observation in a DATA= data set must contain a value for each process and a value for the subgroup-variable. If the ith subgroup contains $n_ i$ items, there should be $n_ i$ consecutive observations for which the value of the subgroup-variable is the index of the ith subgroup. For example, if each subgroup contains five items and there are 30 subgroup samples, the DATA= data set should contain 150 observations.

Other variables that can be read from a DATA= data set include

  • _PHASE_ (if the READPHASES= option is specified)

  • block-variables

  • symbol-variable

  • BY variables

  • ID variables

By default, the MACONTROL procedure reads all of the observations in a DATA= data set. However, if the data set includes the variable _PHASE_, you can read selected groups of observations (referred to as phases) with the READPHASES= option (for an example, see Displaying Stratification in Phases.

For an example of a DATA= data set, see Creating Moving Average Charts from Raw Data.

LIMITS= Data Set

You can read preestablished control limits parameters from a LIMITS= data set specified in the PROC MACONTROL statement. The LIMITS= data set used by the MACONTROL procedure does not contain the actual control limits, but rather it contains the parameters required to compute the limits. For example, the following statements read control limit parameters from the data set Parms:

proc macontrol data=Parts limits=Parms;
   machart Gap*Day;
run;

The LIMITS= data set can be an OUTLIMITS= data set that was created in a previous run of the MACONTROL procedure. Such data sets always contain the variables required for a LIMITS= data set; see the section OUTLIMITS= Data Set. The LIMITS= data set can also be created directly using a DATA step.

When you create a LIMITS= data set, you must provide the variable _SPAN_, which specifies the number of terms to use in the moving average. In addition, note the following:

  • The variables _VAR_ and _SUBGRP_ are required. These must be character variables of length 8.

  • The variable _INDEX_ is required if you specify the READINDEX= option. This must be a character variable whose length is no greater than 48.

  • The variables _LIMITN_, _SIGMAS_ (or _ALPHA_), and _TYPE_ are optional, but they are recommended to maintain a complete set of control limit information. The variable _TYPE_ must be a character variable of length 8. Valid values are 'ESTIMATE', 'STANDARD', 'STDMEAN', and 'STDSIGMA'.

  • BY variables are required if specified with a BY statement.

Some advantages of working with a LIMITS= data set are that

  • it facilitates reusing a permanently saved set of parameters

  • a distinct set of parameters can be read for each process specified in the MACHART statement

  • it facilitates keeping track of multiple sets of parameters that accumulate for the same process as the process evolves over time

For an example, see Reading Preestablished Control Limit Parameters.

HISTORY= Data Set

You can read subgroup summary statistics from a HISTORY= data set specified in the PROC MACONTROL statement. This enables you to reuse OUTHISTORY= data sets that have been created in previous runs of the MACONTROL, SHEWHART, or CUSUM procedures or to read output data sets created with SAS summarization procedures such as PROC MEANS.

A HISTORY= data set used with the MACHART statement must contain the following:

  • the subgroup-variable

  • a subgroup mean variable for each process

  • a subgroup sample size variable for each process

  • a subgroup standard deviation variable for each process

The names of the subgroup mean, subgroup standard deviation, and subgroup sample size variables must be the process name concatenated with the suffix characters X, S, and N, respectively.

For example, consider the following statements:

proc macontrol history=Cliphist;
   machart (Gap Diameter)*Day  / span=3;
run;

The data set Cliphist must include the variables Day, GapX, GapS, GapN, DiameterX, DiameterS, and DiameterN.

Although a moving average variable (named by the process name suffixed with A) is saved in an OUTHISTORY= data set, it is not required in a HISTORY= data set, because the subgroup mean variable is sufficient to compute the moving averages.

Note that if you specify a process name that contains 32 characters, the names of the summary variables must be formed from the first 16 characters and the last 15 characters of the process name, suffixed with the appropriate character.

Other variables that can be read from a HISTORY= data set include

  • _PHASE_ (if the READPHASES= option is specified)

  • block-variables

  • symbol-variable

  • BY variables

  • ID variables

By default, the MACONTROL procedure reads all the observations in a HISTORY= data set. However, if the HISTORY= data set includes the variable _PHASE_, you can read selected groups of observations (referred to as phases) by specifying the READPHASES= option (see Displaying Stratification in Phases for an example).

For an example of a HISTORY= data set, see Creating Moving Average Charts from Subgroup Summary Data.

TABLE= Data Set

You can read summary statistics and control limits from a TABLE= data set specified in the PROC MACONTROL statement. This enables you to reuse an OUTTABLE= data set created in a previous run of the MACONTROL procedure.

The following table lists the variables required in a TABLE= data set used with the MACHART statement:

Variable

Description

_LCLE_

lower control limit for Moving Average

_LIMITN_

nominal sample size associated with the control limits

_MEAN_

process mean

_SPAN_

number of terms in the moving average

subgroup-variable

values of the subgroup-variable

_SUBN_

subgroup sample size

_SUBS_

subgroup standard deviation

_SUBX_

subgroup mean

_UCLA_

upper control limit for moving average

_UWMA_

uniformly weighted moving average

Other variables that can be read from a TABLE= data set include

  • block-variables

  • symbol-variable

  • BY variables

  • ID variables

  • _PHASE_ (if the READPHASES= option is specified). This variable must be a character variable whose length is no greater than 48.

  • _VAR_. This variable is required if more than one process is specified or if the data set contains information for more than one process. This variable must be a character variable of length 8.

For an example of a TABLE= data set, see Saving Control Limit Parameters.