Attribute agreement analysis: kappa and agreement for inspectors
Attribute agreement analysis evaluates a measurement system whose result is a category rather than a number: pass or fail, a defect type, a grade from 1 to 5. It is the counterpart of a crossed gage R&R for judgments. Several appraisers rate the same set of items more than once, without knowing which item is which, and the analysis asks three questions: does each appraiser agree with themselves, do the appraisers agree with each other, and do they agree with the correct answer?
When to use it
- Visual inspection: scratches, color, solder joints, print quality, cosmetic defects.
- Any pass/fail or category decision made by a person, or by a tester you cannot measure on a continuous scale.
- Before using inspection data for a Pareto chart or a P chart, to confirm that the counts mean what they say.
- When you have a known standard for each item (from an expert panel or a precise measurement) and want to know how often inspectors get it right. Without a standard, the study still measures consistency.
How it works
Each appraiser rates every item at least twice, in a random order each time. The results are summarized as percentages of items, each with an exact (Clopper-Pearson) 95% confidence interval:
- Within appraiser: items on which the appraiser gave the same rating on every trial.
- Each appraiser versus standard: items on which all of that appraiser's ratings match the standard.
- Between appraisers: items on which every rating from every appraiser is the same.
- All appraisers versus standard: items on which every rating matches the standard.
Agreement can happen by chance: two inspectors who pass 90% of items at random will agree often. Fleiss' kappa corrects for that. For N items, each rated n times, with n_ij ratings of item i in category j:
P_i = Σ_j n_ij (n_ij − 1) / (n (n − 1))
P̄ = mean of P_i
p_j = Σ_i n_ij / (N n)
P̄_e = Σ_j p_j²
κ = (P̄ − P̄_e) / (1 − P̄_e)κ = 1 is perfect agreement, κ = 0 is what chance alone would give. Within appraiser, the n ratings are that appraiser's trials; between appraisers, they are all ratings of the item. Against the standard, each rating is paired with the standard value.
Rules of thumb vary. One common set calls kappa above 0.75 good and below 0.40 poor; many inspection teams aim for 0.9 or more on critical characteristics.
Example
A plastics plant inspects molded covers for flow lines. A quality engineer sets the standard for ten covers: six pass (P) and four fail (F). Three inspectors rate each cover twice, a day apart, with the covers coded and shuffled.
| Cover | Standard | Inspector A | Inspector B | Inspector C |
|---|---|---|---|---|
| 1 | P | P P | P P | P P |
| 2 | F | F F | F F | F F |
| 3 | P | P P | P F | P P |
| 4 | P | P P | P P | P P |
| 5 | F | F F | F P | P P |
| 6 | P | P P | P P | P P |
| 7 | F | F F | F F | F F |
| 8 | P | P F | P P | P P |
| 9 | P | P P | P P | P P |
| 10 | F | F F | F F | F F |
| Assessment | Agreed | Percent | 95% CI | Fleiss' kappa |
|---|---|---|---|---|
| Within A | 9 of 10 | 90% | 55.5% to 99.7% | 0.80 |
| Within B | 8 of 10 | 80% | 44.4% to 97.5% | 0.58 |
| Within C | 10 of 10 | 100% | 69.2% to 100% | 1.00 |
| A versus standard | 9 of 10 | 90% | 55.5% to 99.7% | 0.90 |
| B versus standard | 8 of 10 | 80% | 44.4% to 97.5% | 0.79 |
| C versus standard | 9 of 10 | 90% | 55.5% to 99.7% | 0.78 |
| Between appraisers | 7 of 10 | 70% | 34.8% to 93.3% | 0.73 |
| All versus standard | 7 of 10 | 70% | 34.8% to 93.3% |
As a check of the kappa formula, take the between-appraisers value: six ratings per cover, so P_i = 1 for the seven covers where all agree, and for cover 3 (five P, one F) P_i = (5×4 + 1×0)/(6×5) = 0.667; covers 5 (three P, three F) and 8 give 0.400 and 0.667. Then P̄ = 0.873, p_P = 37/60 = 0.617, p_F = 0.383, P̄_e = 0.617² + 0.383² = 0.527 and κ = (0.873 − 0.527)/(1 − 0.527) = 0.73.
How to read the results
- Inspector C is consistent but wrong on cover 5. Rating the same failing cover as a pass twice is a systematic error, not a random one: C's idea of an acceptable flow line differs from the standard. Both ratings are false accepts, the most costly kind of error (B also passed cover 5 once). Show C the boundary samples.
- Inspector B is inconsistent. B changed verdicts on covers 3 and 5 (κ = 0.58 within). That points to a borderline defect that is hard to see, or to lighting or viewing conditions. A defined inspection distance and light level often help.
- Inspector A made one false reject. Rejecting a good cover once is a cost, not an escape, but it shows that cover 8 sits near the boundary.
- The intervals are very wide. With ten covers, 90% agreement is compatible with anything from 55% to 99.7%. The point estimates show where to look; they are not proof of a capable inspection. A real study needs many more items, commonly 30 to 50 or more, with about half near the boundary.
Common mistakes
- Choosing only obvious items. Clear passes and gross failures make everyone look good. Include items close to the acceptance boundary.
- Letting appraisers recognize items. If they remember their last verdict, within-appraiser agreement is inflated. Code, shuffle and space the trials apart.
- Reporting only percent agreement. Agreement on mostly good items is easy by chance. Report kappa as well.
- Ignoring the type of error. A false accept and a false reject have different costs; count them separately.
Frequently asked questions
Why does within-appraiser agreement come first?
If an appraiser cannot repeat their own verdict, they cannot agree reliably with anyone else or with the standard. Within-appraiser agreement is the attribute version of repeatability.
What if there is no standard?
Then the study measures consistency only: within and between appraisers. High agreement without a standard can still mean everyone is consistently wrong.
Can I use it for more than two categories?
Yes. Fleiss' kappa works for any number of categories. For ordered categories, such as grades 1 to 5, Kendall's coefficients take the order into account.
How is this different from an attribute gage study?
An attribute gage study uses parts with measured reference values and a mechanical pass/fail gauge, and estimates bias and repeatability in measurement units. Attribute agreement analysis compares people's verdicts in categories.