Sub topic 2
Counting Problems by Category
What you need before starting
This chapter assumes that you can calculate basic percentages and cumulative sums, read a bar chart, and tally events into groups. Basic Python and pandas are needed only for the code example.
A Pareto analysis starts with a categorical frequency table. A category is a named group, such as “Scratches” or “Wrong label.” A frequency is the number of observations in that group. Together, the categories and their frequencies describe how often each type of problem occurs.
For example, a factory may inspect products and record one problem type for each defective product:
| Problem category | Count |
|---|---|
| Scratches | 42 |
| Misalignment | 27 |
| Wrong label | 11 |
| Cracks | 8 |
| Discoloration | 5 |
| Other | 7 |
The total is 100 defects. This makes the counts easy to interpret as percentages. Scratches account for 42% of the defects, and misalignment accounts for 27%.
Define what one count means
Before counting, define the unit of analysis, which is the thing being counted. It might be a defective product, a customer complaint, a late delivery, or a processing error.
A single observation should also have a clear category. If one product has three scratches, you must decide whether to count:
- One defective product under “Scratches”
- Three scratch occurrences
- The total length or repair cost of the scratches
Each choice answers a different question. Counting defective products measures how many products are affected. Counting occurrences measures how many problems were found. Counting cost measures financial impact.
Use one rule consistently across the dataset. Mixing units produces a chart that looks precise but does not represent a meaningful measure.
Make categories usable
Good categories should be:
- Mutually exclusive, meaning one observation does not fit several categories for the same analysis
- Collectively exhaustive, meaning every relevant observation has a category
- Specific enough to guide action
- Stable enough to compare across time
Suppose an inspection form allows “label issue,” “wrong label,” and “missing label.” These categories may overlap unless their definitions are written clearly. A better scheme might define “wrong label” as incorrect information and “missing label” as no label at all.
An “Other” category can capture rare or unexpected problems. Keep it small and review its contents later. If “Other” becomes one of the largest groups, the classification system needs improvement.
Count and check the data
Start with raw records, then tally each category. Check that the total count matches the number of valid observations. Also inspect missing, duplicate, and ambiguous records.
import pandas as pd
defects = pd.Series({
"Scratches": 42,
"Misalignment": 27,
"Wrong label": 11,
"Cracks": 8,
"Discoloration": 5,
"Other": 7,
})
total = defects.sum()
summary = pd.DataFrame({
"count": defects,
"percent": (defects / total * 100).round(1),
}).sort_values("count", ascending=False)
print(summary)
print(f"Total defects: {total}")The code creates a frequency table and sorts it from the largest category to the smallest. Sorting is essential for a Pareto chart because the bars must descend from left to right.
The percentage denominator must match the question. If you are studying all defects, use total defects. If you are studying late orders, use total late orders. Do not silently exclude a category because it makes the leading cause look larger.
Prepare the categories for analysis
A Pareto chart usually places a catch-all category such as “Other” last, even if its count is larger than a small named category. This keeps the named causes together and makes the chart easier to interpret.
A frequency table is not yet an explanation of cause. It tells you how often each category appears. Further investigation is needed to learn why the problems occur and whether fixing a category is practical.
Exercise
A team records 200 customer complaints. Forty are about delivery delays, 30 about damaged packaging, and 10 about incorrect invoices. The remaining 120 complaints are divided among several named categories. What must the team check before building a Pareto chart?
Show answer
It should define what one complaint represents, ensure each complaint has one consistent category, verify that all 200 complaints are included, review the large remaining group instead of treating it as unexplained “Other,” and choose whether count or another measure answers the improvement question.