Sub topic 6
Choosing a Control Chart: A Decision Path
Assume you know how to calculate a mean, range, and standard deviation. You should also understand that observations arrive in time order and that a process can contain common-cause or special-cause variation. Basic probability helps with proportions and counts. The code example uses basic Python only.
Chart selection depends on three questions:
- What kind of output did you measure?
- How many observations belong to each time period or subgroup?
- Are you counting defective items or counting defects?
Start with the data type
Variables data are measurements on a continuous scale, such as length, weight, temperature, or cycle time. Attribute data are counts or classifications, such as defective items or defects found.
| Data and sampling structure | Chart | What it tracks |
|---|---|---|
| One continuous measurement per period | I-MR | Individual values and moving ranges |
| Several continuous measurements in each rational subgroup | X-bar and R | Subgroup means and within-subgroup ranges |
| Defective items out of inspected items | p | Proportion defective |
| Defects found across units or opportunities | u | Defects per unit |
A defective item fails a requirement. Count it once, even if it has several faults. A defect is one nonconformity. One item can contain several defects, so defects can outnumber units.
Follow the decision path
For one measurement at a time, use an I-MR chart. The I chart monitors each individual value. The MR chart monitors the absolute difference between consecutive values. This choice is common when testing is expensive, production is slow, or the process naturally produces one result per period.
For several continuous measurements collected under comparable conditions, use an X-bar and R chart. The X-bar chart monitors subgroup averages. The R chart monitors the range within each subgroup. A common subgroup size is between 2 and 10. Larger subgroups may require an X-bar and S chart instead, where S is the subgroup standard deviation.
For defective items, use a p chart. Each period has a count of defective items, \(d\), and a sample size, \(n\). The plotted value is \(p=d/n\). The sample size may remain constant or vary. When it varies, the control limits vary with it.
For defects per unit, use a u chart. Each period has a defect count, \(c\), and a number of units or opportunities, \(nu\). The plotted value is \(u=c/nu\). Use this chart when one unit can contain multiple defects or when the amount inspected changes.
Make the choice explicit in code
def choose_chart(data_type, measurements_per_period=1, count_kind=None):
if data_type == "continuous":
if measurements_per_period == 1:
return "I-MR"
if measurements_per_period >= 2:
return "X-bar and R"
raise ValueError("measurements_per_period must be positive")
if data_type == "count":
if count_kind == "defective_items":
return "p"
if count_kind == "defects":
return "u"
raise ValueError("count_kind must be 'defective_items' or 'defects'")
raise ValueError("data_type must be 'continuous' or 'count'")
print(choose_chart("continuous", measurements_per_period=1))
print(choose_chart("count", count_kind="defects"))This function does not calculate limits. It records the sampling logic that determines which limit formulas and assumptions apply.
Check the sampling design
The chart choice can be wrong even when the data type is correct. For an X-bar and R chart, form rational subgroups: measurements collected close together under the same operating conditions. The subgroup should expose short-term variation within the process. Differences between subgroups should reveal changes over time.
Do not create subgroups merely because measurements are convenient to store together. If each subgroup mixes different machines, shifts, or materials, the range may reflect between-condition differences and distort the chart.
A p chart requires a clear denominator: the number of items inspected. A u chart requires a clear exposure measure: units, length, area, time, or another countable opportunity. If exposure changes but you plot raw defect counts, the chart can signal only because more was inspected.
Exercise
A support team records the number of tickets with at least one error each day and the total tickets reviewed. Which chart should it use, and why?
Show answer
Use a p chart because each ticket is classified as defective or not defective, and the denominator is the number of tickets reviewed.