You can read raw data (process measurements) from a DATA= data set specified in the PROC SHEWHART statement. Each process specified in the XCHART 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 subgroupvariable. The subgroupvariable, which is specified in the XCHART 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 subgroupvariable. If the ith subgroup contains items, there should be consecutive observations for which the value of the subgroupvariable 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)
blockvariables
symbolvariable
BY variables
ID variables
By default, the SHEWHART 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 the section Displaying Stratification in Phases).
For an example of a DATA= data set, see Creating Charts for Means from Raw Data.
You can read preestablished control limits (or parameters from which the control limits can be calculated) from a LIMITS=
data set specified in the PROC SHEWHART statement. For example, the following statements read control limit information from
the data set Conlims
:^{[83]}
proc shewhart data=Info limits=Conlims; xchart Weight*Batch; run;
The LIMITS= data set can be an OUTLIMITS= data set that was created in a previous run of the SHEWHART procedure. Such data sets always contain the variables required for a LIMITS= data set; see Table 17.67. The LIMITS= data set can also be created directly using a DATA step. When you create a LIMITS= data set, you must provide one of the following:
the variables _LCLX_
, _MEAN_
, and _UCLX_
, which specify the control limits directly
the variables _MEAN_
and _STDDEV_
, which are used to calculate the control limits according to the equations in Table 17.66
In addition, note the following:
The variables _VAR_
and _SUBGRP_
are required. These must be character variables whose lengths are no greater than 32.
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', 'STDMU', and 'STDSIGMA'.
BY variables are required if specified with a BY statement.
For an example, see Reading Preestablished Control Limits.
You can read subgroup summary statistics from a HISTORY= data set specified in the PROC SHEWHART statement. This enables you to reuse OUTHISTORY= data sets that have been created in previous runs of the SHEWHART, CUSUM, or MACONTROL procedures or to read output data sets created with SAS summarization procedures, such as the MEANS procedure.
A HISTORY= data set used with the XCHART statement must contain the following:
the subgroupvariable
a subgroup mean variable for each process
a subgroup sample size variable for each process
either a subgroup range variable or subgroup standard deviation variable for each process
If you specify the STDDEVIATIONS option, the subgroup standard deviation variable must be included; otherwise, the subgroup range variable must be included.
The names of the subgroup mean, subgroup range or subgroup standard deviation, and subgroup sample size variables must be the process name concatenated with the suffix characters X, R or S, and N, respectively.
For example, consider the following statements:
proc shewhart history=Summary; xchart (Weight Yieldstrength)*Batch; run;
The data set Summary
must include the variables Batch
, WeightX
, WeightR
, WeightN
, YieldstrengthX
, YieldstrengthR
, and YieldstrengthN
. If the STDDEVIATIONS option were specified in the preceding XCHART statement, it would be necessary for Summary
to include the variables Batch
, WeightX
, WeightS
, WeightN
, YieldstrengthX
, YieldstrengthS
, and YieldstrengthN
.
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)
blockvariables
symbolvariable
BY variables
ID variables
By default, the SHEWHART procedure reads all of the observations in a HISTORY= data set. However, if the data set includes
the variable _PHASE_
, you can read selected groups of observations (referred to as phases) by specifying the READPHASES= option (see the section Displaying Stratification in Phases for an example).
For an example of a HISTORY= data set, see Creating Charts for Means from Subgroup Summary Data.
You can read summary statistics and control limits from a TABLE= data set specified in the PROC SHEWHART statement. This enables you to reuse an OUTTABLE= data set created in a previous run of the SHEWHART procedure. Because the SHEWHART procedure simply displays the information in a TABLE= data set, you can use TABLE= data sets to create specialized control charts. Examples are provided in Specialized Control Charts: SHEWHART Procedure.
The following table lists the variables required in a TABLE= data set used with the XCHART statement:
Table 17.70: Variables Required in a TABLE= Data Set
Variable 
Description 


lower control limit for mean 

nominal sample size associated with the control limits 

process mean 
subgroupvariable 
values of the subgroupvariable 

subgroup sample size 

subgroup mean 

upper control limit for mean 
Other variables that can be read from a TABLE= data set include
blockvariables
symbolvariable
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.
_TESTS_
(if the TESTS= option is specified). This variable is used to flag tests for special causes and must be a character variable
of length 8.
_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 whose length is no greater than 32.
For an example of a TABLE= data set, see Saving Control Limits.