Sub topic 8
Choosing Categories and Measuring by Count or Cost
What this chapter assumes
You should already know how to tally events into categories, compute a cumulative percentage, and read a basic Pareto chart. The code uses pandas, and you should be comfortable with Series, sort_values, and cumsum.
The earlier chapters covered how to build and read the chart. This chapter covers the two decisions you make before drawing anything: how to define the categories, and what to measure for each one. These decisions often matter more than the chart's styling, because the same raw data can produce different "vital few" lists depending on how you answer them.
Two decisions, not one
A Pareto chart answers the question "which categories account for most of the total?" That question has two hidden parameters:
- The category scheme. This is how you slice the problem into groups, such as defect type, machine, shift, or supplier.
- The measure. This is what you add up inside each group, such as number of events, money lost, hours of downtime, or customers affected.
Change either parameter and the ranking can change. A chart is only as useful as these two choices, so make them on purpose and write them down.
Choosing categories
Properties of a good category scheme
A usable scheme has these properties:
- Mutually exclusive. Each event falls into exactly one category. If a scratched and misaligned part can be logged under both, you will double count and the percentages stop adding up to 100.
- Collectively exhaustive. Every event lands somewhere. A catch-all "Other" bucket guarantees this, but it must stay small.
- Actionable. A category should point toward someone who can act on it. "Operator error" is a poor category, because it tells you nothing about which step to change. "Label printer misfeed" is better.
- Comparable in granularity. Categories should sit at the same level of detail. Mixing "Scratches" with "Scratch on left panel, line 2, night shift" produces a chart where the detailed category is artificially small.
- Recorded consistently. If different inspectors use different words for the same defect, clean the labels first. "Scratch", "scratches", and "surface scratch" should be one category.
Choosing the level of detail
Categories that are too broad hide the cause. If 60% of complaints fall under "Quality", you have learned almost nothing. Categories that are too narrow split one real cause into many small bars, so no single bar looks important.
A practical approach is to start broad, find the dominant bar, and then drill down into it with a second chart. Drill-down charts get their own chapter. For now, aim for roughly 5 to 10 categories on a single chart. Fewer than 4 gives you little to rank. More than about 12 usually means the scheme is too fine.
You can also slice the same data in different ways, such as by defect type, by machine, or by shift. Each slice is a different Pareto chart, and each can reveal a different concentration. A flat chart by defect type might be followed by a strongly skewed chart by machine, which tells you where to look.
Keeping "Other" under control
By convention, "Other" goes last on the chart, even if it is larger than some named bars. That convention keeps the descending order meaningful for the named categories.
The risk is a large "Other". If it is bigger than your biggest named bar, the chart is hiding information. As a rule of thumb, "Other" should be well under 10 to 15% of the total. If it is not, go back to the raw records and split it into real categories.
The function below folds tiny categories into "Other" when their share is under a threshold. It is useful when raw data contains many rare labels.
import pandas as pd
def fold_small(series, min_share=0.03, other="Other"):
"""Merge categories below min_share of the total into the Other bucket."""
share = series / series.sum()
small = (share < min_share) & (series.index != other)
folded = series[~small].copy()
folded[other] = folded.get(other, 0) + series[small].sum()
return folded
cost = pd.Series({
"Scratches": 210,
"Misalignment": 1080,
"Wrong label": 1320,
"Cracks": 2400,
"Discoloration": 50,
"Other": 140,
})
folded = fold_small(cost, min_share=0.03)
print(folded)
print(f"Other share: {folded['Other'] / folded.sum():.1%}")Here "Discoloration" (about 1% of cost) is folded into "Other", which then holds 190 of 5,200, or 3.7%. Folding is a judgment call. Before you fold a small category, check that it is not a rare but dangerous problem. We return to that case below.
Choosing the measure
Count
Counting events is the simplest option. It needs only a tally sheet, and everyone understands it. It answers "what happens most often?"
Its weakness is that it treats every event as equal. One cracked housing that ships to a customer and one cosmetic scratch each add 1.
Cost
Measuring money lost per category answers "what hurts the budget most?" To compute it, multiply the number of events by a cost per event, or sum the actual costs recorded for each event. Typical cost components are scrap, rework labor, warranty claims, and expedited shipping.
Cost matches the way a business makes decisions, but it needs data that is often messy. Unit costs are estimates, and some costs (lost reputation) are hard to quantify. State your assumptions next to the chart.
Other measures
| Measure | Question it answers | Typical use | Main risk |
|---|---|---|---|
| Count | What happens most often? | Early screening, no cost data yet | Treats minor and severe events alike |
| Cost | What costs the most money? | Business case, budget priorities | Unit costs may be rough guesses |
| Time (downtime, delay, rework hours) | What wastes the most time? | Process speed, equipment reliability | Time may not reflect money or safety |
| Customers affected | What touches the most people? | Service, support, complaints | Ignores severity per customer |
| Severity-weighted score | What is the most serious overall? | Safety, regulated products | Weights are subjective |
A worked example: the same data, two rankings
The defect data from earlier chapters has 100 defects. Suppose each defect type also has an average cost per occurrence:
| Defect | Count | Cost per defect | Total cost |
|---|---|---|---|
| Scratches | 42 | 5 | 210 |
| Misalignment | 27 | 40 | 1,080 |
| Wrong label | 11 | 120 | 1,320 |
| Cracks | 8 | 300 | 2,400 |
| Discoloration | 5 | 10 | 50 |
| Other | 7 | 20 | 140 |
This code builds the Pareto table for each measure with the same helper:
import pandas as pd
counts = pd.Series({
"Scratches": 42,
"Misalignment": 27,
"Wrong label": 11,
"Cracks": 8,
"Discoloration": 5,
"Other": 7,
})
unit_cost = pd.Series({
"Scratches": 5,
"Misalignment": 40,
"Wrong label": 120,
"Cracks": 300,
"Discoloration": 10,
"Other": 20,
})
cost = counts * unit_cost
def pareto_table(series, last="Other"):
main = series.drop(last).sort_values(ascending=False)
data = pd.concat([main, series[[last]]])
cum_pct = (data.cumsum() / data.sum() * 100).round(1)
return pd.DataFrame({"value": data, "cumulative_pct": cum_pct})
print("By count")
print(pareto_table(counts))
print()
print("By cost")
print(pareto_table(cost))The two tables tell different stories:
- By count, the order is Scratches, Misalignment, Wrong label, Cracks, Discoloration, then Other. The cumulative share reaches 42%, 69%, and 80% after the first three. Scratches are the top priority.
- By cost, the order is Cracks, Wrong label, Misalignment, Scratches, Discoloration, then Other. Cracks alone account for about 46% of the money lost. The first three categories reach about 92%, and Scratches fall to fourth place.
Scratches are the most frequent defect but cost only 210 in total. Cracks occur eight times and cost 2,400. If you chose a measure by habit, you might spend your improvement effort on the cheapest problem.
Neither chart is "wrong". They answer different questions. The mistake is presenting one without saying which measure it uses. Always put the measure in the axis label, for example "Defect count" or "Cost of defects (USD)".
When cost data is missing
You often do not have reliable cost figures. Three practical options:
- Start with counts and say clearly that the chart ranks frequency, not impact.
- Use a proxy that is easier to record, such as rework minutes.
- Ask the people closest to the process for a rough unit cost per category, and label the figures as estimates. A rough cost that is in the right order of magnitude is more useful than no cost at all.
Always record where each number came from. Sensitivity matters here: if doubling a unit cost estimate does not change the ranking of the top categories, the conclusion is stable.
Rare but severe categories
A Pareto chart ranks by total, so a category with very few events and a catastrophic outcome can sit at the far right, or inside "Other". Safety incidents are the classic case. One injury may matter more than a thousand scratches, and no unit cost fully captures that.
Handle this in one of three ways:
- Exclude critical categories from the chart and manage them separately, with their own controls.
- Use a severity-weighted score as the measure, with the weights agreed in advance.
- Keep them as named bars and annotate them, instead of folding them into "Other".
A decision flow
The diagram summarizes the sequence of decisions in this chapter.
Common errors
- Choosing the measure after seeing the results. If you try count, then cost, then time, and publish the one that supports your favorite fix, you have pre-selected the answer. Decide the measure from the question first.
- Mixing units across categories. Do not add dollars for one category and hours for another. Every bar must use the same unit.
- Overlapping categories. "Packaging damage" and "Shipping damage" may describe the same event. Define each category so that a person logging an event can choose one without hesitation.
- Changing the scheme between charts. For a before-and-after comparison, both charts must use identical categories and the same measure. Otherwise the change you see may only be a change in definitions.
- Ignoring the time window. Counts from one week and costs from one year are not comparable. State the period and use one period per chart.
- Treating a big "Other" as finished. If "Other" is the tallest bar, return to the data.
Summary of the decisions
- State the question the chart must answer.
- Pick a category scheme that is exclusive, exhaustive, actionable, and at one level of detail.
- Keep "Other" small and never use it to hide severe categories.
- Pick count, cost, time, or a weighted score, based on what the decision depends on.
- Compare rankings under more than one measure when you can, and explain any disagreement.
- Label the measure, the period, and the source of any estimates on the chart.
Exercise
A team logs 200 customer complaints in a month. "Late delivery" has 90 complaints at an average refund of 4. "Billing error" has 30 complaints at an average refund of 60. "Damaged item" has 50 complaints at an average refund of 25. "Other" has 30 complaints at an average refund of 10. (a) Rank the named categories by count and by total refund cost. (b) Which category would you tackle first if the goal is to reduce refund spending, and why? (c) What is the share of "Other" by count, and is it acceptable?
Show answer
(a) By count: Late delivery (90), Damaged item (50), Billing error (30), then Other (30) last. By cost: Billing error is 30 x 60 = 1,800, Damaged item is 50 x 25 = 1,250, Late delivery is 90 x 4 = 360, and Other is 30 x 10 = 300. The ranking by cost is Billing error, Damaged item, Late delivery, then Other. (b) Billing error, because it accounts for 1,800 of the 3,710 total refund cost (about 49%) despite being only third by count. Late delivery is the most frequent complaint but costs the least per event. (c) Other is 30 of 200, which is 15% by count. That is at the upper edge of the rule of thumb, so it is worth checking whether the records in Other can be split into real categories.