Calculate Cohen's kappa from paired ratings of the same items: subtract the agreement expected from the two inspectors' category frequencies from their observed agreement, then divide by one minus that expected agreement. Report the original table and percent agreement beside kappa. The coefficient measures agreement; it does not establish that either inspector is correct.
If two people disagree about which products meet a specification, an attractive overall pass rate can hide the problem. Before arguing about the number of bad units, check whether they apply the same classification consistently.
Give both inspectors the same question
Start with a defined unit, specification and classification. This guide uses exactly two inspectors, each independently giving one of two nominal labels to every item: conforming or nonconforming. Neither label has a degree of severity inside it.
In an original fictional study, two inspectors examine the same one hundred plain paper display cards for a specified cosmetic printing condition. They use the same approved specification, test conditions and available equipment. The inspection does not alter the cards.
Each records a decision before seeing the other's decision. Preserve the item identifier and both original labels. A conversation that produces a shared answer can help resolve a product question, but that negotiated answer is not an independent second rating.
Keep a disagreement category out of the rating choices themselves. “They disagree” describes a comparison between two completed labels; it is not a label that either inspector assigns to the product.
This finite exercise is not a lot-release or supplier-approval decision. It examines how two people classified this set. Generalizing to future work would need an appropriate study design and uncertainty assessment.
Build the paired table
For the one hundred fictional cards, both inspectors call forty conforming and forty-five nonconforming. Inspector A calls ten conforming that B calls nonconforming. A calls another five nonconforming that B calls conforming.
Each card appears in exactly one interior cell. Rows contain A's original labels; columns contain B's. Neither inspector is treated as the truth.
| Inspector A | B: conforming | B: nonconforming | A total |
|---|---|---|---|
| Conforming | 40 | 10 | 50 |
| Nonconforming | 5 | 45 | 50 |
| B total | 45 | 55 | 100 |
The diagonal holds agreements: 40 + 45 = 85. Observed agreement, usually written pₒ, is therefore 85/100 = 0.85, or 85%.
The off-diagonal holds fifteen disagreements. Their directions matter: ten cards are conforming for A but not B; five go the other way. A dashboard reporting only “fifteen differences” loses that distinction.
Calculate the marginal agreement baseline
A uses the conforming label on 50% of cards and the nonconforming label on 50%. B uses those labels on 45% and 55%, respectively.
For kappa's baseline, imagine independent label assignment preserving each inspector's category proportions. Expected matching on conforming is 0.50 × 0.45 = 0.225. Expected matching on nonconforming is 0.50 × 0.55 = 0.275.
Add those to obtain expected agreement pₑ = 0.50. This is a mathematical reference based on the table's margins. It does not establish that the inspectors actually guessed, or identify which of their eighty-five matches occurred by luck.
The official scikit-learn documentation defines Cohen's kappa using observed agreement and an expected agreement estimated from each annotator's label distribution. Its formula is:
κ = (pₒ − pₑ) ÷ (1 − pₑ).
Substitute the original table's values: (0.85 − 0.50)/(1 − 0.50) = 0.70. The observed agreement exceeds the baseline by 0.35; the available distance from that baseline to complete agreement is 0.50. Their ratio is 0.70.
Do not report this as “70% accurate.” Nor does it mean only seventy cards matched. Eighty-five matched; kappa adjusts that agreement relative to its specified baseline.
Why the same agreement can produce a different kappa
Consider a separate invented study of another one hundred cards. Both inspectors call eighty-five conforming. Ten are conforming for A and nonconforming for B; five are nonconforming for A and conforming for B. Neither calls any card nonconforming together.
Raw agreement is still 85%. But A now calls 95% conforming and B calls 90% conforming. Their nonconforming proportions are 5% and 10%.
The baseline becomes 0.95 × 0.90 + 0.05 × 0.10 = 0.86. Kappa is (0.85 − 0.86)/(1 − 0.86) = −1/14, approximately −0.0714.
That negative result means observed matching falls below this marginal-frequency baseline. It does not show that 85% agreement was miscounted, or prove deliberate disagreement. The coefficient and raw agreement describe different aspects of the supplied table.
The two studies are separate cases, not before-and-after evidence of improvement. The distribution of labels changed substantially. Comparing kappa values without those distributions can hide what changed.
Keep the table with the coefficient, especially when one category is uncommon. A high overall match rate may say little about whether the two people agree on the infrequent condition that matters operationally.
Agreement is not a reference standard
Return to the first table. It contains no independently established correct classifications. Calling B the standard merely because B has more experience would add a claim that the data do not establish.
For a separate teaching branch, suppose a competent reference review supplies a correct binary classification for every card. Of the forty both called conforming, thirty-eight really conform and two do not. Of the forty-five both called nonconforming, forty-two really do not conform and three do.
Among the ten A called conforming and B called nonconforming, six actually conform and four do not. Among the five labeled the opposite way, two actually conform and three do not.
A now has 38 + 42 + 6 + 3 = 89 correct decisions. B has 38 + 42 + 4 + 2 = 86. They still agree on eighty-five cards, including five on which both were wrong.
These are wholly supplied reference outcomes, not a claim about real inspectors. The lesson is that agreement and correctness require different evidence. A real reference process needs its own justified method; naming a person “expert” does not make every judgment infallible.
Know when the coefficient is undefined
If both inspectors assign every card to the same single category, observed agreement is one and expected agreement is one. The formula becomes 0/0, so kappa is undefined.
Report complete observed agreement and the single-category limitation. Do not silently replace the undefined value with one, zero or a reassuring word. The supplied labels offer no variation for this chance-adjusted calculation.
Likewise, an absent rating is not a nonconforming product. Missing observations need their own record and a justified handling rule. Deleting inconvenient pairs can change the study as well as its result.
MedCalc's documentation distinguishes ordinary nominal classifications from weighted kappa for ordered scales. This guide uses the unweighted calculation. A three-level severity scale would require deciding how disagreement is to be treated rather than quietly reusing the binary example.
A missing pair changes the calculation
For a separate arithmetic branch, remove five specified pairs from the complete first table: two of the forty conforming agreements, one of the forty-five nonconforming agreements, and one from each disagreement cell. This illustrates the effect of unavailable paired records; it is not permission to discard known results.
The remaining table is thirty-eight, nine, four and forty-four in the same cell order. There are ninety-five complete pairs and eighty-two agreements, giving 82/95, approximately 86.3158% observed agreement.
A's category totals are forty-seven and forty-eight; B's are forty-two and fifty-three. Expected agreement is (47 × 42 + 48 × 53)/95² = 4,518/9,025. Kappa becomes 3,272/4,507, approximately 0.7260.
The coefficient rose after records were removed. That does not show improved inspection. Report the missing five, the handling rule and the changed denominator. Investigate whether missingness relates to difficult items before using the remaining pairs to describe all work. Treating the missing five as agreements would create observations that were never available.
Use the disagreements to improve the method
Review the actual fifteen disputed cards from the first study. Were requirements unclear? Did lighting, handling or equipment differ? Did one inspector apply an obsolete specification? The table identifies where judgments differed, not why.
Preserve the original independent labels when a later discussion resolves a card. Store any adjudicated result separately with its basis. Replacing both original ratings with the consensus would manufacture agreement in the study record.
Define what performance the task requires before using a cutoff to authorize work. A coefficient alone cannot establish whether a particular disagreement risk is acceptable. The consequences of missing a condition may differ from the consequences of unnecessary rejection.
After changing the method or training, evaluate suitable fresh evidence. Do not call repeated ratings of remembered cards an independent demonstration of future performance without addressing that dependence.
Keep a usable study record
Keep item references, both original ratings, category definitions, specification version, conditions, missing-data handling, the complete table, calculations and the review action together. A reader should be able to reconstruct the result from the preserved pairs.
The calibration-certificate guide examines evidence about a measuring instrument. The first-pass-yield guide follows production and repair outcomes. Here the distinct question is whether two inspectors classify the same units consistently.
Explore Infinite Upside
For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.
Choose an edition
Choose an edition