Sub topic 3
Choosing Categories and Measuring by Count or Cost
Prerequisites
This chapter assumes you can compute percentages and running totals, read a bar chart, and run pandas code. The examples use a small set of defect records.
Choosing categories and measuring by count or cost
A Pareto analysis depends on two choices: how you group the events, and what you add up for each group. Grouping by defect type is usually clearest. Each group needs a single measure. A count treats every event as equal. A cost weights each event by its impact, such as scrap value, rework hours, or downtime.
The two measures can disagree. The code below ranks the same defects by count and by cost.
import pandas as pd
counts = pd.Series({"Scratches": 42, "Misalignment": 27, "Wrong label": 11,
"Cracks": 8, "Discoloration": 5})
cost_each = pd.Series({"Scratches": 12, "Misalignment": 40, "Wrong label": 150,
"Cracks": 95, "Discoloration": 20})
by_count = counts.sort_values(ascending=False)
by_cost = (counts * cost_each).sort_values(ascending=False)
print(by_count)
print(by_cost)By count, Scratches lead. By cost, Wrong label leads with 1650 of 4094 total cost units. Choose the measure that matches the decision. If the goal is to cut rework money, use cost.
Using a Pareto chart to decide what to fix first
Sort the categories from largest to smallest, then add a cumulative percentage. Stop at the first category that pushes the running total past 80 percent. Those categories form the vital few, and they are the first candidates for improvement.
With the cost figures above, Wrong label, Misalignment, and Cracks reach 85.3 percent of total cost. Those three categories form the vital few.
Limits of the 80/20 rule and common chart mistakes
The 80/20 split is a rough pattern. Your data may give 70/30 or 90/10. Do not force the cutoff to 80 percent.
Other common errors include:
- Mixing counts and costs on the same chart.
- Hiding a large "Other" bucket that hides a real problem.
- Using too many categories, which makes the bars too small to read.
Before/after charts and drilling down
After a fix, build the same chart for a new period, using the same categories and measure. Compare the bars side by side. If one bar dropped but the total did not, the fix may have moved the problem to another category.
When a top category is broad, drill down. Split "Scratches" into sub-causes, such as location or machine, and build a second Pareto chart for that category only.
Why 80/20 patterns appear: a note on power laws
Many real-world distributions have a few large contributors and a long tail of small ones. Statisticians describe these with power-law distributions. A power law explains why the pattern appears often, but it does not guarantee a 80/20 split in any given dataset.
Exercise
Exercise
Using the cost figures in the code above, how many categories are needed to reach 80 percent of total cost, and which are they?
Show answer
Three: Wrong label (40.3 percent), Misalignment (26.4 percent), and Cracks (18.6 percent). Together they reach 85.3 percent. The first two only reach 66.7 percent, so the third is needed to pass 80 percent.