Chapter Contents |
Previous |
Next |
XCHART Statement |
See SHWXCHR in the SAS/QC Sample Library |
The previous example illustrates how you can create charts using raw data (process measurements). However, in many applications, the data are provided as subgroup summary statistics. This example illustrates how you can use the XCHART statement with data of this type.
The following data set (PARTS) provides the data from the preceding example in summarized form:
data parts; input sample partgapx partgapr; partgapn=5; label partgapx='Mean of Gap Width' sample ='Sample Index'; datalines;
1 270 35 2 258 25 3 248 24 4 260 39 5 273 29 6 260 21 7 259 37 8 248 37 9 260 28 10 255 19 11 268 36 12 253 36 13 273 29 14 275 22 15 257 24 16 269 41 17 249 36 18 264 31 19 258 25 20 248 36 21 248 30 ;
A listing of PARTS is shown in Figure 42.3. There is exactly one observation for each subgroup (note that the subgroups are still indexed by SAMPLE). The variable PARTGAPX contains the subgroup means, the variable PARTGAPR contains the subgroup ranges, and the variable PARTGAPN contains the subgroup sample sizes (these are all five).
You can read this data set by specifying it as a HISTORY=
data set in the PROC SHEWHART statement, as follows:
title 'Mean Chart for Gap Width'; proc shewhart history=parts lineprinter; xchart partgap*sample='*'; run;
The resulting chart is shown in Figure 42.4. Since the LINEPRINTER option is specified in the PROC SHEWHART statement, line printer output is produced. The asterisk (*) specified in single quotes after the subgroup-variable indicates the character used to plot points. This character must follow an equal sign.
Note that PARTGAP is not the name of a SAS variable in the data set but is, instead, the common prefix for the names of the three SAS variables PARTGAPX, PARTGAPR, and PARTGAPN. The suffix characters X, R, and N indicate mean, range, and sample size, respectively. Thus, you can specify three subgroup summary variables in a HISTORY= data set with a single name (PARTGAP), which is referred to as the process. The name SAMPLE specified after the asterisk is the name of the subgroup-variable.
|
In general, a HISTORY= input data set used with the XCHART
statement must contain the following variables:
Furthermore, the names of the subgroup mean, range (or standard deviation), and sample size variables must begin with the process name specified in the XCHART statement and end with the special suffix characters X, R (or S), and N, respectively. If the names do not follow this convention, you can use the RENAME option in the PROC SHEWHART statement to rename the variables for the duration of the SHEWHART procedure step (see "Creating Charts for Means and Ranges from Summary Data" ).
If you specify the STDDEVIATIONS option in the XCHART statement,
the HISTORY= data set must contain a subgroup standard deviation
variable; otherwise, the HISTORY= data set must contain a subgroup
range variable.
The STDDEVIATIONS option specifies that the estimate
of the process standard deviation is to be
calculated from subgroup standard deviations rather
than subgroup ranges.
For example, in the following statements, the data set PARTS2
must contain a subgroup standard deviation variable named PARTGAPS:
title 'Mean Chart for Gap Width'; proc shewhart history=parts2; xchart partgap*sample='*' / stddeviations; run;
Options such as STDDEVIATIONS are specified after the slash (/) in the XCHART statement. A complete list of options is presented in the "Syntax" section.
In summary, the interpretation of process depends on the
input data set.
For more information, see "HISTORY= Data Set" .
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.