P_Chart
P_Chart
P_Chart
7/24/2009
P Chart
Summary
The P Chart procedure creates a control chart for data that describes the proportion of times an
event occurs in m samples taken from a product or process. The data might represent the
proportion of defective items in a manufacturing process, the proportion of customers that return
a product, or any other attribute that can be classified as acceptable or unacceptable. Out-of-
control signals are highlighted, including both points beyond the control limits and any unusual
runs in the data. The chart may be constructed in either Initial Study (Phase 1) mode, where the
current data determine the control limits, or in Control to Standard (Phase 2) mode, where the
limits come from either a known standard or from prior data.
The data for this analysis consist of m samples from a population detailing:
Sample Data:
The file cans.sgd contains inspection results from m = 94 samples taken from a manufacturing
process, each corresponding n = 50 cardboard orange juice cans. The data is presented by
Montgomery (2005). Each can was inspected and the number of defective cans was tabulated.
The table below shows a partial list of the data in that file:
Sample n Defects
1 50 12
2 50 15
3 50 8
4 50 10
5 50 4
6 50 7
7 50 16
8 50 9
9 50 14
10 50 10
11 50 5
12 50 6
13 50 17
14 50 12
15 50 22
The first m = 30 samples were taken prior to a machine adjustment. The next 24 samples were
then used to establish control limits for the process. The final 40 samples were plotted using the
established control limits.
Data Input
The data required by this procedure is a numeric column containing the proportions of
unacceptable items in the m samples.
Sample Sizes: the number of items in each sample. If all sample sizes are equal, you can
enter a single value such as “50”. Otherwise, enter a column with the sizes corresponding to
each proportion.
LSL, Nominal, USL: optional lower specification limit, nominal (target) value, and upper
specification limit.
Note the use of the FIRST operator to select only the first m = 30 rows for the initial Phase 1
analysis. Note also that the proportions of defective items are calculated “on-the-fly” by dividing
the numbers of defective items by the sample sizes:
dj
pj (1)
nj
P Chart
The P Chart plots the sample proportions pj.
0.2
0.1
0
0 5 10 15 20 25 30
Sample
In Phase 1 (Initial Studies) mode, the centerline and control limits are determined from the data.
The centerline is located at the weighted average of the sample proportions:
n
j 1
j pj
p m
(2)
n
j 1
j
The control limits are placed above and below the centerline at:
p (1 p )
pk (3)
n
where k is the sigma multiple specified on the Control Charts tab of the Preferences dialog box
(k = 3 except in rare cases) and n is the sample size. If the sample sizes are not equal, then
depending on Analysis Options, n is replaced by either:
(1) n , the average sample size. In this case, the control limits are the same for all
samples.
(2) nj , the individual sample sizes. In this case, the control limits are step functions.
Any points beyond the control limits will be flagged using a special point symbol. Any point
excluded from the analysis, usually by clicking on a point on the chart and pressing the
Exclude/Include button, will be indicated by an X. If so indicated on the Pane Options dialog
box, unusual sequences of points may also be flagged. In the current chart, 2 points are beyond
Pane Options
Outer Warning Limits: check this box to add warning limits at the specified multiple of
sigma, usually at 2 sigma.
Inner Warning Limits: check this box to add warning limits at the specified multiple of
sigma, usually at 1 sigma.
Moving Average: check this box to add a moving average smoother to the chart. In addition
to the sample proportions, the average of the most recent q points will also be displayed,
where q is the order of the moving average. The default value q = 9 since the 1-sigma inner
warning limits for the original proportions are equivalent to the 3-sigma control limits for
that order moving average.
Exponentially Weighted Moving Average: check this box to add an EWMA smoother to
the chart. In addition to the sample proportions, an exponentially weighted moving average
of the sample proportions will also be displayed, where is the smoothing parameter of the
EWMA. The default value = 0.2 since the 1-sigma inner warning limits for the original
proportions are equivalent to the 3-sigma control limits for that EWMA.
Decimal Places for Limits: the number of decimal places used to display the control limits.
Color Zones: check this box to display green, yellow and red zones.
Display Specification Limits: whether to add horizontal lines to the chart displaying the
location of the specification limits (if any).
To determine how the control chart would change without those 2 samples, click on each with
your mouse and press the Exclude/Include button on the analysis toolbar. The centerline and
control limits will be recalculated, resulting in the following chart:
0.2
0.1
0
0 5 10 15 20 25 30
Sample
Each of the excluded points has been replaced by an X and a label added to the chart (using the
Add Text button on the analysis toolbar).
P Chart Report
This pane tabulates the values plotted on the control chart:
p Chart Report
Samples Beyond Limits
X = Excluded * = Beyond Limits
Sample Size p
15 50 * 0.44
23 50 * 0.48
Out-of-control points are indicated by an asterisk. Points excluded from the calculations are
indicated by an X.
Pane Options
Analysis Summary
The Analysis Summary summarizes the data and the control chart.
p Chart
Period #1-30
UCL: +3.0 sigma 0.410239
Centerline 0.231333
LCL: -3.0 sigma 0.0524275
2 beyond limits
Estimates
Period #1-30
Mean p 0.231333
Sigma 0.0596353
Sample Information: the number of samples m and the average sample size
n
j 1
j
n (4)
m
If any samples have been excluded from the calculations, that number is also displayed.
p Chart: a summary of the centerline and control limits for the p chart. Using Analysis
Options, separate limits may be calculated for different periods (sets of samples).
ˆ p (5)
p(1 p)
(6)
n
Analysis Options
Type of Study: determines how the control limits are set. For an Initial Study (Phase 1)
chart, the limits are estimated from the current data. For a Control to Standard (Phase 2)
chart, the control limits are determined from the information in the Control to Standard
section of the dialog box.
Normalize: if selected, all statistics will be normalized by calculating Z-scores and the Z-
scores plotted on the charts. The centerline on such a chart is always located at 0, and the
control limits are always located at k.
Use Zone Format: if checked, the statistics will be plotted using a zone chart rather than the
usual format. See the example below.
Recalculate at: the control limits of the chart may be recalculated at up to 4 locations along
the X axis by specifying the sample numbers at which new estimates are to be initiated.
Separate estimates of the mean proportion will be obtained using the data in the different
sections. In such cases, the control limits will be adjusted at the start of each new period.
P Chart Control Limits: specify the multiple k to use in determining the upper and lower
control limits on the p chart. To suppress a limit completely, enter 0.
Control to Standard: to perform a Phase 2 analysis, select Control to Standard for the Type
of Study and then enter either of the following:
Specify Parameters: specify the established standard mean proportion of defective items.
Specify Control Limits: specify the location of the centerline and control limits exactly
where you wish them to be placed.
Exclude button: Use this button to exclude specific samples from the calculations. It will
display the following dialog box:
1. Select Manual, enter the sample (subgroup) number to exclude, and press OK. The
control limits will be recalculated without that subgroup and the chart replotted.
Points may also be excluded by clicking on them while viewing a control chart and then
pressing the Exclude/Include button on the analysis toolbar.
0.2 3 1 1 3 1 1 1
9
2 7 2 2 3
0.1 7 5 7
0
0 5 10 15 20 25 30
Sample
Above each observation is a running count based on the latest run of observations either above
the centerline or below the centerline. Beginning at 0, a cumulative score is attached to each
point on the chart in the following manner:
o If the point is within the inner warning limits, the score is incremented by 1.
o If the point is beyond the inner warning limits but within the outer warning limits, the
score is incremented by 2.
o If the point is beyond the outer warning limits but within the control limits, the score
is incremented by 4.
o If the point is beyond the control limits, the score is incremented by 8.
Whenever the process crosses the centerline, the score is reset to 0. Values exactly equal to the
centerline do not change the score. When the score reaches a critical value (8 is the default), an
out-of-control signal is generated.
The above rule is the default but may be overridden on the Runs Tests tab of the Preferences
dialog box, accessible through the Edit menu.
In addition, the score may be reset to 0 immediately after each out-of-control signal.
In the chart above, the maximum score reached 8 or more during 3 runs.
Then access Analysis Options and ask for new limits to be calculated beginning at sample 31:
Separate control limits will then be computed for samples 1-30 and 31-54. The limits for the last
section are displayed on the chart:
0.2
0.1
0
0 10 20 30 40 50 60
Sample
Runs Tests
The Runs Tests pane displays the results of standard tests applied to the p chart to look for
unusual sequences of points.
Runs Tests
Rules
(A) runs above or below centerline of length 8 or greater.
(B) runs up or down of length 8 or greater.
(C) sets of 5 subgroups with at least 4 beyond 1.0 sigma.
(D) sets of 3 subgroups with at least 2 beyond 2.0 sigma.
(E) sets of 15 subgroups at or within 1.0 sigma.
(F) sets of 8 subgroups beyond 2.0 sigma.
(G) sets of 8 observations alternating up and down
Violations
Observation p Chart
20 G
21 G
22 DG
23 DG
24 CDG
25 C
Depending on the default settings on the Runs Tests tab of the Preferences dialog box,
STATGRAPHICS will look for up to 7 different types of patterns:
C. A group of 5 points in which at least 4 are more than 1-sigma away from the centerline,
on the same side of the centerline.
D. A group of 3 points in which at least 2 are more than 2-sigma away from the centerline,
on the same side of the centerline.
F. A group of 8 or more points, all beyond 2-sigma, but not necessarily on the same side of
the centerline.
Any such runs will be indicated in the above table and also on the control charts (unless
suppressed).
Runs tests are designed to make standard Shewhart charts more sensitive to small shifts in the
process. In the current situation, rule G detects an up and down oscillation beginning at time
period j = 20.
Pane Options
Select the runs tests to be applied and the parameters that define those tests. For example, some
practitioners prefer to test for runs of length 7 rather than 8.
Phase 2 Analyses
The discussion above deals with a Phase 1 study, in which the goal was to bring the process into
a state of statistical control and estimate a standard value for the mean proportion of defective
items. After the machine adjustment, the process appeared to stabilize around a proportion =
0.1108.
In a Phase 2 study, additional data is collected and plotted with control limits based on that
standard. Rows 55-94 of the sample data file represent such a case.
To perform a Phase 2 study on the sample data, the data input dialog box will first be modified to
remove the earlier Subset selection:
Next, the Type of Study will be switched to Control to Standard in the Analysis Options dialog
box and the standard proportion entered:
The resulting chart has the same centerline and control limits as before:
0.2
0.1
0
0 20 40 60 80 100
Sample
The process appears to have remained in control during the period in which the additional data
was collected.
OC Curve
The OC (Operating Characteristic) Curve is designed to illustrate the properties of a Phase 2
control chart.
OC Curve for p
1
0.8
Pr(accept)
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4
Process proportion
The chart displays the probability that a sample proportion will be within the control limits on
the p chart, as a function of the true process proportion of unacceptable items. For example, if the
process proportion were to shift to 0.2, the sample estimate would remain within the limits
approximately 80% of the time and thus not generate an out-of-control signal. That probability
drops to about 5% if the proportion of unacceptable items equals 0.4.
ARL Curve
The ARL Curve is another way to view the performance of a Phase 2 p chart.
400
Average run length
300
200
100
0
0 0.04 0.08 0.12 0.16 0.2
Process proportion
The ARL curve plots the average run length (average number of samples plotted up to and
including the first point beyond the control limits) as a function of the true process proportion.
Assuming that the proportion of unacceptable items suddenly shifts to a new value, the chart
shows how long it takes on average until an out-of-control signal is generated (not counting any
signals from run rules violations). For very small shifts, it can take in excess of 350 samples on
average to detect the shift. Expanding the chart in the vicinity of 0.2 shows:
8
Average run length
0
0.19 0.194 0.198 0.202 0.206 0.21 0.214
Process proportion
The responsiveness of the p chart depends on the sample size n. To help determine a good
sample size, see the documentation for the Control Chart Design procedure.
Save Results
The following results can be saved to the datasheet: