Sub topic 9
Checking coding reliability
Pull-through rates depend on human judgment. A coder reads an article and decides whether it contains the message "secure". If a second coder would have decided differently, the rate you report measures the coder as much as the coverage. A reliability check tests whether the codebook produces the same decisions when different people apply it.
This chapter assumes you have a coverage set, a key-message framework, and a coding sheet where each article gets a yes or no per message (see the chapters on key messages and coding). It also assumes you can read basic Python. It covers how to run a double-coding check, calculate agreement and Cohen's kappa, interpret the results, and act on them.
Why reliability needs its own check
Coding errors do not average out the way random noise does. They often lean one way. A coder who accepts loose paraphrases will inflate pull-through. A coder who wants the exact phrase will deflate it. If the same coder works through the whole period, the bias stays steady and trends look fine, but the level is off. If coders change midway, you may report a "decline in pull-through" that is just a new coder with a stricter reading.
A reliability check does three things:
- It tells you whether the codebook is clear enough to be applied the same way by different people.
- It gives you a number to report next to the results, so readers can judge how much to trust them.
- It points to the specific messages or rules that cause disagreement, so you can fix them.
Reliability is not the same as validity. Two coders can agree consistently and both be wrong about what the message means. Reliability is a necessary condition for a trustworthy measurement, not a sufficient one.
Designing the double-coding check
Double coding means that two coders independently code the same sample of articles. "Independently" is the important word. If coder B sees coder A's answers, you are measuring conformity, not reliability.
Choosing the sample
- Size. For a coverage set of a few hundred articles, double-code at least 10 to 20 percent, and not fewer than about 30 articles. For very small sets, double-code everything.
- Selection. Draw the sample at random from the coverage set. Do not let coders pick "typical" articles. If you code several outlet types (national, trade, broadcast transcripts), stratify, so each type appears in the sample.
- Rare messages. If a message appears in only a few articles, a random sample may contain almost no positives. Check that the sample has enough articles where at least one coder found the message, or increase the sample for that message.
- Timing. Run a small pilot before full coding, and repeat the check during the project. A single check at the start does not show whether coders drift over time.
Preparing the coders
Give both coders the same written codebook. For each message, the codebook states the definition, which phrasings count, which do not, and a few borderline examples. Coders should be trained on a separate set of practice articles, not on the reliability sample.
Percent agreement
The simplest measure is percent agreement: the share of articles where both coders gave the same code.
Percent agreement = articles where coders agree ÷ articles double-coded
It is easy to explain, but it has a weakness. Two coders who guess at random will still agree some of the time. With a yes/no code, coin flips agree about half the time. When one answer is much more common than the other, agreement by chance is higher still. Percent agreement does not remove this chance agreement, so it overstates reliability.
Cohen's kappa
Cohen's kappa corrects percent agreement for the agreement expected by chance. It applies to two coders and categorical codes, such as present or absent.
kappa = (observed agreement − expected agreement) ÷ (1 − expected agreement)
Observed agreement is the percent agreement. Expected agreement is calculated from how often each coder used each code. For each code, multiply the share of articles coder A gave that code by the share coder B gave it, then add these products across codes.
A kappa of 1 means perfect agreement. A kappa of 0 means agreement no better than chance. Negative values mean the coders agree less than chance would predict, which usually points to a misunderstanding of the codebook.
A worked example
Two coders double-code 20 articles for the message "secure". They both mark it present in 9 articles and both mark it absent in 8. Coder A marks it present while coder B marks it absent in 2 articles, and the reverse happens in 1 article.
- Observed agreement: (9 + 8) ÷ 20 = 0.85.
- Coder A said present in 11 articles (0.55) and absent in 9 (0.45).
- Coder B said present in 10 articles (0.50) and absent in 10 (0.50).
- Expected agreement: 0.55 × 0.50 + 0.45 × 0.50 = 0.50.
- Kappa: (0.85 − 0.50) ÷ (1 − 0.50) = 0.70.
The following code does the same calculation. It also runs a second case, explained in the next section.
def cohens_kappa(coder_a, coder_b):
"""Return (percent_agreement, kappa) for two equal-length lists of codes."""
if len(coder_a) != len(coder_b) or not coder_a:
raise ValueError("Need two non-empty lists of equal length")
n = len(coder_a)
observed = sum(a == b for a, b in zip(coder_a, coder_b)) / n
labels = set(coder_a) | set(coder_b)
expected = sum(
(coder_a.count(label) / n) * (coder_b.count(label) / n)
for label in labels
)
if expected == 1:
# Both coders used a single identical code throughout; kappa is undefined.
return observed, None
return observed, (observed - expected) / (1 - expected)
# Worked example: 1 = message present, 0 = absent.
coder_a = [1] * 9 + [1] * 2 + [0] * 1 + [0] * 8
coder_b = [1] * 9 + [0] * 2 + [1] * 1 + [0] * 8
agreement, kappa = cohens_kappa(coder_a, coder_b)
print(f"Common message: agreement {agreement:.1%}, kappa {kappa:.2f}")
# Rare message: 100 articles, present in very few.
rare_a = [1] * 1 + [1] * 2 + [0] * 97
rare_b = [1] * 1 + [0] * 2 + [0] * 97
agreement, kappa = cohens_kappa(rare_a, rare_b)
print(f"Rare message: agreement {agreement:.1%}, kappa {kappa:.2f}")
# Common message: agreement 85.0%, kappa 0.70
# Rare message: agreement 98.0%, kappa 0.49Why kappa can look low when agreement is high
The second case in the code shows the most common source of confusion. Two coders double-code 100 articles for a message that is rare. They agree on 98 of them, which is 98 percent. But kappa is only 0.49.
Here is why. Both coders say "absent" almost every time, so chance alone would produce about 96 percent agreement. Only the remaining 2 to 4 percentage points of agreement count as skill, and the coders missed on 2 articles out of the 3 that coder A flagged. Kappa shows that the coders are not reliably finding the message, and percent agreement hides it.
This matters in media analysis because many key messages are rare. A message that appears in 5 percent of articles is exactly the type that makes pull-through numbers volatile. The practical rules:
- Always report both percent agreement and kappa, and the counts behind them.
- Calculate reliability per message, not as one average across all messages. A good average can hide one unreliable message.
- For rare messages, double-code a larger sample, or oversample articles that either coder flagged, and report that you did so.
| Measure | What it tells you | Weakness |
|---|---|---|
| Percent agreement | Share of articles with identical codes | Inflated by chance, especially for rare codes |
| Cohen's kappa | Agreement beyond chance, two coders | Can be low when one code is very common, even with few errors |
| Krippendorff's alpha | Agreement beyond chance, any number of coders, handles missing codes | More work to calculate by hand; use a library |
Reading the number
There is no universal pass mark. Many practitioners use these rough bands for kappa:
| Kappa | Common reading |
|---|---|
| Below 0.40 | Poor to fair: do not report without fixing the codebook |
| 0.40 to 0.60 | Moderate: acceptable only for exploratory work |
| 0.60 to 0.80 | Substantial: usable, with limitations stated |
| 0.80 and above | Strong: suitable for reporting and benchmarking |
Content-analysis guidance often asks for 0.80 or higher on coded variables, and treats values from about 0.67 to 0.80 as tentative. Set your target before you check, not after you see the result. A target of 0.80 for messages that feed a client dashboard and 0.67 for a one-off exploratory study is a defensible policy. A target chosen after the fact is not.
Resolving disagreements and fixing the codebook
A low number is only useful if it leads to a change. After each check:
- List every article where the coders differed, grouped by message.
- Have the coders explain their reasoning without assigning blame. Most disagreements fall into a few patterns: a paraphrase that one coder accepted and the other rejected, a quote from a competitor that included your message, or a message that appears only in a caption or headline.
- Write a rule for each pattern into the codebook, with the disputed article as an example.
- If a message is too vague to code consistently, rewrite it, split it into two messages, or drop it from the framework.
- Retrain on the new rules, then recode a fresh random sample. Do not recode the same articles, because the coders now remember them.
For the final dataset, decide how to settle differences in articles that were coded twice. Common options are a third senior coder who decides each disagreement, or a discussion between the two coders. Record which method you used. Articles coded by only one person keep that person's code.
Edge cases to plan for
- Zero variance. If both coders mark a message absent in every sampled article, kappa is undefined (the formula divides by zero). The code above returns
Nonein that case. Report that the message did not appear in the sample, and do not claim it is reliable. - More than two coders. Cohen's kappa is for pairs. For three or more coders, or when different coders code different articles, use Krippendorff's alpha.
- Messages with levels. If you code "full message", "partial message", and "absent", kappa still works, but a disagreement between full and partial is less serious than one between full and absent. A weighted kappa gives partial credit for near misses.
- Coder drift. Agreement can fall over a long project as coders relax or invent shortcuts. Schedule repeat checks, for example every 100 articles or at the start of each reporting period.
- Machine-assisted coding. If software tags messages by keyword, treat the software as one coder and compare it with a human on a sample in the same way.
Reporting the check
State the following next to your pull-through figures: the number of articles double-coded and how they were selected, the number of coders, the statistic used, the result per message, the target you set, and what you changed after the check. A short note is enough, for example: "Two coders double-coded 40 randomly selected articles. Kappa was 0.82 for 'secure', 0.74 for 'fast', and 0.61 for 'affordable'; the definition of 'affordable' was tightened and recoded."
Exercise
Two coders double-code 50 articles for the message "fast". Both mark it present in 4 articles and both mark it absent in 44. Coder A marks it present in 1 article where coder B marks it absent, and coder B marks it present in 1 article where coder A marks it absent. Calculate percent agreement and kappa, then say what the result suggests.
Show answer
Observed agreement is (4 + 44) ÷ 50 = 0.96, or 96%. Coder A said present in 5 articles (0.10) and absent in 45 (0.90). Coder B gave the same split: 5 present (0.10) and 45 absent (0.90). Expected agreement is 0.10 × 0.10 + 0.90 × 0.90 = 0.01 + 0.81 = 0.82. Kappa is (0.96 − 0.82) ÷ (1 − 0.82) = 0.14 ÷ 0.18, which is about 0.78. Agreement is high and kappa is substantial but just under a 0.80 target. The message is rare, so each disagreement moves kappa a lot. Report both figures, review the two disputed articles, and consider a larger sample before treating the pull-through rate for "fast" as firm.
Exercise
A team reports a single average kappa of 0.81 across five messages and says coding is reliable. Name two reasons this may be misleading and what they should report instead.
Show answer
First, an average can hide a weak message: four messages at 0.90 and one at 0.45 average to 0.81, yet pull-through for the weak message cannot be trusted. Second, the average says nothing about sample size, how articles were chosen, or whether rare messages had enough positive cases to test. They should report kappa and percent agreement per message, with the number of articles double-coded, how the sample was drawn, and the target they set in advance.