Chapter Contents 
Previous 
Next 
CCHART Statement 
See SHWCCHR1 in the SAS/QC Sample Library 
A c chart is used to monitor the number of paint defects on new trucks. Twenty trucks of the same model are inspected, and the number of paint defects per truck is recorded. The following statements create a SAS data set named TRUCKS, which contains the defect counts:
data trucks; input truckid $ defects @@; label truckid='Truck Identification Number' defects='Number of Paint Defects'; datalines; C1 5 C2 4 C3 4 C4 8 C5 7 C6 12 C7 3 C8 11 E4 8 E9 4 E7 9 E6 13 A3 5 A4 4 A7 9 Q1 15 Q2 8 Q3 9 Q9 10 Q4 8 ;
A listing of TRUCKS is shown in Figure 33.1.

There is a single observation per truck. The variable TRUCKID identifies the subgroup sample and is referred to as the subgroupvariable. The variable DEFECTS contains the number of nonconformities in each subgroup sample and is referred to as the process variable (or process for short).
The following statements create the c chart shown in Figure 33.2:
title 'c Chart for Paint Defects on New Trucks'; proc shewhart data=trucks lineprinter; cchart defects*truckid='*'; run;
This example illustrates the basic form of the CCHART statement. After the keyword CCHART, you specify the process to analyze (in this case, DEFECTS) followed by an asterisk and the subgroupvariable (TRUCKID).
Since the LINEPRINTER option is specified in the PROC SHEWHART statement, line printer output is produced. The asterisk (*) specified in single quotes after the subgroupvariable specifies the character used to plot points. Note that this character must follow an equal sign.
Each point on the c chart represents the number of nonconformities for a particular subgroup. For instance, the value plotted for the first subgroup is 5 (since there are five paint defects on the first truck). By default, the control limits shown are 3 limits estimated from the data; the formulas are given at "Control Limits" . Since none of the points exceed the limits, the c chart indicates that the painting process is in statistical control.
See "Constructing Charts for Numbers of Nonconformities (c Charts)" for details concerning c charts. For more details on reading raw data, see "DATA= Data Set" .
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.