Measurement systems
Attribute Agreement Study Design: How Many Parts, How Many Fails, and How Sure Is Kappa
An attribute agreement study gives each inspector the same parts twice and reports kappa. Two choices made before anyone looks at a part, how many parts and how many of them are fails, decide much of the result. This guide shows how the mix of parts moves kappa for an inspector whose behavior has not changed, how wide the interval around a kappa from 30 parts is, and how many parts and fails a study needs, with one synthetic inspection of carton date codes that can be pasted into the site's calculator.
Quick answer
Kappa against the reference mixes two things: how often an inspector passes a fail or rejects a good part, and the share of fails in the study set. For an inspector who misses 20 % of fails and rejects 5 % of good parts, kappa is about 0.68 when 10 % of the parts are fails and about 0.77 when 40 % are, so the same inspector falls either side of the 0.75 guidance depending on the parts chosen. In the model used here, the 95 % interval around a kappa from 30 parts is about 0.2 to 0.6 wide, and in repeated simulated studies of 30 parts with 3 fails this inspector scored at least as high as a much better one 14 % of the time. Build the study set with roughly a third to a half fails, report the miss rate and false-alarm rate with their intervals next to kappa, and size the number of fail parts from the miss rate you need to rule out: if 24 fail judgments are independent and equally hard and none is missed, a miss rate above 11.7 % is excluded at 95 % confidence.
What the study can estimate
The study design, the agreement percentages and Cohen's kappa are explained in the measurement system analysis guide, and the Attribute Agreement Analysis (Kappa) calculator computes them for two inspectors who each judge every part twice. This guide uses two further quantities that come straight from the same table when a reference judgment exists:
- Miss rate = judgments that call a reference fail "pass" ÷ judgments made on reference fails. With 12 fails judged twice, the denominator is 24.
- False-alarm rate = judgments that call a reference pass "fail" ÷ judgments made on reference passes.
Each rate is measured only on parts of one kind, so adding or removing parts of the other kind does not change it, as long as the parts of each kind are as hard to judge as before and the inspection conditions are the same (definition). The calculator reports the two counts summed over both inspectors as "fails called pass" and "passes called fail"; the split by inspector is read from the table. Kappa against the reference uses all the judgments at once, which is why it also depends on the mix.
Why the part mix moves kappa
For an inspector with miss rate m and false-alarm rate f judging a set in which a share π of the parts are fails, every quantity in kappa follows from the three numbers (derivation):
pₒ = π(1 − m) + (1 − π)(1 − f) q = π(1 − m) + (1 − π)f pₑ = πq + (1 − π)(1 − q) κ = (pₒ − pₑ)/(1 − pₑ)
where q is the share of the inspector's judgments that say fail. Chance agreement pₑ depends on the shares of each category, so it moves with the mix of parts [K1]. For inspector A, who misses 5 % of fails and rejects 2 % of good parts, and inspector B, who misses 20 % and rejects 5 %:
| Fails in the study set | 10 % | 20 % | 30 % | 40 % | 50 % |
|---|---|---|---|---|---|
| Kappa against the reference, A | 0.879 | 0.920 | 0.931 | 0.933 | 0.930 |
| Kappa against the reference, B | 0.675 | 0.750 | 0.768 | 0.766 | 0.750 |
Neither inspector changes across a row; only the parts do. B is below 0.75 with a production-like set of 10 % fails and above it with 30 % to 40 %. Commonly quoted guidance treats a kappa of at least 0.75 as good agreement and prefers values such as 0.90 [K3]; with a production-like mix, that guidance would judge B on the parts chosen as much as on B's eye. The effect is largest when fails are rare; between about a fifth and a half of fails, B's kappa stays between 0.75 and 0.77. That is one reason to load the study set with fails, as the calculator page advises. A difference between two kappas from sets with different shares of fails should not be read as a difference between inspectors.
How sure is a kappa from 30 parts
A standard error for Cohen's kappa that is simple enough to compute by hand is
SEκ = √(pₒ(1 − pₒ) / (n(1 − pₑ)²))
with a 95 % interval of κ ± 1.96 SEκ [K1]. Here n is the number of paired judgments: the site's calculator pools both trials, so 30 parts give 60 pairs. In Minitab, Fleiss' kappa is the default, and Cohen's kappa can be requested when an appraiser has exactly two trials, when two appraisers have one trial each, or against a standard [K2][K3]; the pooled pairs used here are the calculator's convention, and the formula treats them as independent, which is an approximation.
To see how much kappa moves from one study to the next, 100,000 studies were simulated for each design below, with A and B judging every part twice at the rates above and every judgment independent (simulation on this page; the code and seeds are in the notes):
| Parts, fails | B's true kappa | Middle 90 % of B's kappa | Studies where B ≥ A | Studies where B < 0.75 |
|---|---|---|---|---|
| 30, 3 | 0.675 | 0.43 to 0.91 | 14.2 % | 70.4 % |
| 30, 12 | 0.766 | 0.61 to 0.90 | 4.3 % | 39.7 % |
| 50, 20 | 0.766 | 0.65 to 0.87 | 1.2 % | 41.0 % |
| 100, 40 | 0.766 | 0.69 to 0.84 | 0.05 % | 35.6 % |
| 200, 80 | 0.766 | 0.71 to 0.82 | below 0.01 % | 31.2 % |
Two things follow. A small study with few fails cannot reliably rank two inspectors: with 30 parts and 3 fails, the inspector who misses four times as many fails came out level or ahead in one study in seven. And a pass/fail verdict against 0.75 for an inspector whose true kappa is close to 0.75 stays uncertain in every design tested here, up to 200 parts: B's true value is 0.766, yet about a third of the 200-part studies put it below 0.75.
The simple standard error is an approximation. In the same simulations its 95 % interval contained B's true kappa in 90 % to 95 % of studies across the designs in the table, and A's true kappa, which is close to 1, in only 75 % of the 30-part, 3-fail studies and 93 % of the 200-part, 80-fail studies. The interval can also run past 1, the largest possible kappa. Read it as a rough measure of precision, wider in reality than it looks when kappa is high and the study is small.
How many parts and how many fails
The approximate half-width of the 95 % interval, from the same formula with each inspector's true pₒ and pₑ in place of the estimates:
| Parts | 10 % fails: B | 10 % fails: A | 40 % fails: B | 40 % fails: A |
|---|---|---|---|---|
| 30 | 0.31 | 0.20 | 0.17 | 0.09 |
| 50 | 0.24 | 0.15 | 0.13 | 0.07 |
| 100 | 0.17 | 0.11 | 0.09 | 0.05 |
| 200 | 0.12 | 0.08 | 0.07 | 0.04 |
For B, going from 10 % to 40 % fails narrows the interval as much as going from 30 to 100 parts. McHugh suggests no fewer than 30 comparisons for a kappa [K1]; the table shows that 30 is a floor, not a guarantee of precision.
For deciding whether an inspector catches fails well enough, the miss rate is the more direct quantity, and its precision depends only on the number of fail judgments. If an inspector passes none of k fail judgments, and the judgments are independent with the same chance of a miss, the miss rate can be bounded above at 95 % confidence by 1 − 0.05^(1/k) (derivation; it is the success-run relation of the success-run sample size guide applied to fail judgments):
| Fail judgments with no miss | 6 | 24 | 40 | 60 | 80 |
|---|---|---|---|---|---|
| 95 % upper bound on the miss rate | 39.3 % | 11.7 % | 7.2 % | 4.9 % | 3.7 % |
Three fails judged twice say almost nothing; twelve fails judged twice rule out a miss rate above about 12 %; ruling out 5 % takes about 60 fail judgments, for example 30 fail parts judged twice. These bounds assume every judgment is independent. Two looks at the same hard part are not, so a more cautious count uses fail parts rather than fail judgments: if each fail part counts as one test that is passed only when both looks call it fail, and the parts are independent and alike, 12 fail parts with no miss bound the chance that a fail part is missed at least once at 22.1 %.
Worked example: carton date codes, 30 parts, 12 fails
Inspectors A and B judge whether the printed date code on a carton is legible (P) or not (F). A reference judgment for each carton was made beforehand under magnification. The 30 cartons include 12 reference fails, and each inspector judges every carton twice in a random order. The data are synthetic, drawn from the model above with the rule given in the notes so that each inspector's counts equal the expected counts, rounded. Paste the block into the Attribute Agreement Analysis (Kappa) calculator:
Part,Ref,A1,A2,B1,B2
1,P,P,P,P,P
2,P,P,P,P,P
3,P,P,P,P,P
4,P,P,P,P,P
5,P,P,P,P,P
6,P,P,P,P,P
7,P,P,P,F,P
8,P,P,P,P,P
9,P,P,P,P,P
10,F,F,F,F,F
11,P,P,P,P,P
12,F,F,F,F,F
13,P,P,P,P,P
14,P,P,P,P,P
15,F,F,F,F,F
16,P,P,F,P,P
17,P,P,P,P,P
18,P,P,P,P,P
19,P,P,P,P,P
20,F,F,F,F,F
21,F,F,F,F,F
22,F,F,F,P,F
23,F,F,F,F,F
24,P,P,P,P,P
25,F,F,F,F,P
26,P,P,P,F,P
27,F,F,F,P,F
28,F,F,F,F,F
29,F,F,F,F,P
30,F,F,P,P,F
Step 1: the calculator. It reports κ = 0.68 between A and B, κ = 0.93 for A and 0.75 for B against the reference, within-inspector agreement of 93.3 % for A and 76.7 % for B, and 6 judgments that call a fail pass and 3 that call a pass fail.
Step 2: rates by inspector. From the table:
| Inspector A | Inspector B | |
|---|---|---|
| Misses (fails called pass) | 1 of 24 = 4.2 % | 5 of 24 = 20.8 % |
| 95 % interval, miss rate | 0.1 % to 21.1 % | 7.1 % to 42.2 % |
| False alarms (passes called fail) | 1 of 36 = 2.8 % | 2 of 36 = 5.6 % |
| 95 % interval, false-alarm rate | 0.1 % to 14.5 % | 0.7 % to 18.7 % |
The intervals are exact binomial (Clopper–Pearson) intervals, treating each judgment as independent.
Step 3: the interval around each kappa. With the pₒ and pₑ shown in the calculator's details and n = 60, treating the 60 pairs as independent (an approximation):
| κ | pₒ | pₑ | SEκ | 95 % interval | |
|---|---|---|---|---|---|
| A vs B | 0.68 | 0.850 | 0.530 | 0.098 | 0.49 to 0.87 |
| A vs reference | 0.93 | 0.967 | 0.520 | 0.048 | 0.84 to 1 (the formula gives 1.03) |
| B vs reference | 0.75 | 0.883 | 0.530 | 0.088 | 0.58 to 0.92 |
For B against the reference, SEκ = √(0.883 × 0.117 / (60 × 0.470²)) = 0.088.
Reading the results. B's kappa against the reference rounds to 0.75 (0.752), the guidance value, but its interval runs from 0.58 to 0.92, so the study cannot say on which side of 0.75 B really is. The miss rates are clearer: B passed 5 of the 24 judgments on illegible codes, and even the low end of B's interval, 7.1 %, is above A's estimate. The direction is the useful finding. B's five misses fall on five different cartons, so they do not come from one hard carton; B's boundary for "legible" is worth checking against the five codes B passed, with boundary samples, as the measurement system analysis guide recommends for the same pattern. A's observed error rates are low, but the study is too small to show that A's true rates are low enough: A's miss-rate interval still reaches 21 %.
Common mistakes
- Building the study set at the production reject rate. With 3 fails in 30, kappa is low and noisy even for a good inspector, and the miss rate rests on six judgments. Load the set with fails and borderline parts, a third to a half of the set, and state the mix with the result.
- Comparing kappas from studies with different mixes. The same inspector scores 0.68 at 10 % fails and 0.77 at 40 % in the model above. Compare miss and false-alarm rates instead, or keep the mix fixed.
- Reading a kappa from 30 parts to two decimals. In the model used here the interval is about 0.2 to 0.6 wide. A change from 0.81 to 0.78 between two 30-part studies is not, by itself, evidence that anything changed.
- Treating the simple interval as exact. It was too narrow in the simulation when kappa was high and fails were few, and it can exceed 1. Report it as approximate.
- Counting two looks at one part as two independent tests. A part that is hard to judge tends to be misjudged twice. When the miss rate decides an inspector's qualification, count fail parts as well as fail judgments.
- Using kappa alone to qualify an inspector. Kappa does not say whether the disagreements ship defects or reject good parts. The miss rate, with its upper bound, answers the question that matters for escapes.
Using the tools and guides
The Attribute Agreement Analysis (Kappa) calculator computes the agreement percentages, the three kappas with their pₒ and pₑ, and the summed miss and false-alarm counts; the standard errors, intervals and per-inspector rates in this guide are calculated by hand from its output and the data table. The measurement system analysis guide sets out the study and the kappa formula. The success-run sample size guide and the Success-Run Sample Size calculator give the zero-failure bound used for the miss rate. The statistical tables guide lists the normal value 1.960 used in the intervals.
Sources and further reading
- [K1] McHugh, M. L. (2012), Interrater reliability: the kappa statistic, Biochemia Medica 22(3), 276–282 — the standard error and confidence interval of kappa, the minimum of 30 comparisons, and the dependence of chance agreement on the marginal shares.
- [K2] Minitab Support, Methods and formulas for kappa statistics for Attribute Agreement Analysis — when Cohen's and Fleiss' kappa are computed.
- [K3] Minitab Support, Kappa statistics for Attribute Agreement Analysis — the 0.75 and 0.90 guidance.
- Referenced by name; not reproduced here: Cohen, J. (1960), A coefficient of agreement for nominal scales, Educational and Psychological Measurement 20; AIAG Measurement Systems Analysis (MSA) Reference Manual.
- Kitstead Labs guides: Measurement system analysis, Success-run sample size, Statistical tables.