Measurement, Reliability, and the Codebook

Week 8 · Chapter 8

Research Proposals: Fixes Most of You Still Need to Make

  • Framing: write three to five one-sentence points that name the platform, the accounts, and the dates
  • Theory: write numbered points that say what the theory leads you to expect in your own material
  • Literature: group the studies by theme and say what they show together, not one study at a time
  • Gap: name the two or three closest studies, say what each did not do, and state the question that is still open
  • Hypotheses: state that two things you record are associated (“is associated with”); never write “will” or “leads to”

Research Proposals: Fixes for Your Coding Plan

  • What you code: name the unit you code (for example, one post or one comment) and the fixed categories each item can receive
  • Recode check: code about 10 percent of your items again, 48 or more hours later, with your first codes hidden; rewrite the rule behind any code that changed
  • Comparison: for each research question, say what you will compare, and match it to the level of measurement of each variable

Research Proposals: Fixes for Your Sample and Claims

  • Sample: write selection rules someone else could follow to collect the same set, rather than picking items because they fit
  • Sample size: choose a number of items you can finish coding before Describing Data on November 23
  • Claims: claim only what your coded material can show; make no claims about causes and no predictions

Today’s Agenda

  • The four levels of measurement (NOIR) and which statistics each level allows
  • How reliability (consistency) differs from validity (accuracy)
  • The standard two-coder reliability protocol, and the one-coder protocol you will run
  • The five parts of a codebook
  • The six elements Definitions Practice asks for

Why Tonight’s Topics Matter

Week 8 · Chapter 8

  • Levels of measurement are decisions you make about each variable
    • The level you choose decides which statistical tests you may run in November
    • By November there is no time to recode your sample at a different level
  • The second topic is the codebook
    • The assignments in the second half of this course all build on your codebook
  • Due Monday, October 19, 11:59 PM: Definitions Practice

The Four Levels of Measurement (NOIR)

Level of measurement: the kind of information a variable’s values carry, which decides what you may later do with them. Example: game holds names, and viewers holds counts.

  • NOIR names the four levels: nominal, ordinal, interval, and ratio
  • The stream_log columns give an example of each level
    • The columns are channel, title, game, viewers, and date

The data does not fix the level. The level depends on how you decide to measure the variable.

Nominal

Nominal: categories that are only names, with no order. Example: game holds Fortnite, Just Chatting, Art, and Hearthstone, and no arithmetic relates them.

  • channel is nominal, and so is title kept as its original text
  • You can count each category and report the most common one

You cannot average a nominal variable: there is no average of Fortnite and Art.

Ordinal

Ordinal: categories with a meaningful order, where the distances between them are not guaranteed equal. Example: titles binned short, medium, and long, where short-to-medium need not match medium-to-long.

  • You can rank cases and report the median, but a mean is not meaningful

Median: the middle value once the values are sorted. Example: the middle category when every title is lined up from short to long.

Interval

Interval: numbers with equal distances between them but no true zero, so a difference means something and a ratio does not. Example: the posting time of each message, where a minute is a minute anywhere in the column.

  • The zero point, 1970, is a convention; it does not mean “no time”
    • date stores each time as milliseconds counted from 1970
  • Ratios are meaningless: a message posted at 2:00 was not posted twice as late as one posted at 1:00

Ratio

Ratio: numbers with equal distances and a true zero, where zero means none at all. Example: viewers, where zero means nobody is watching, so 28,000 really is twice the audience of 14,000.

  • Elapsed time, such as hours since the stream started, is ratio
  • You may add, subtract, multiply, and divide ratio values
  • Most counts are ratio, such as viewers, characters, and messages

One Column Can Be Measured at Three Levels

The title column of stream_log, measured three ways:

  • Kept as the original text: nominal
  • Counted in characters: ratio, because a title can have zero characters
  • Grouped into short, medium, and long: ordinal

The level depends on how you choose to measure the column.

Exercise: Name the Level of Each Variable

For each variable, name its level of measurement and the feature that shows it: whether the values are ordered, whether the distances are equal, and whether zero means none.

  1. Whether a comment contains a question: yes or no
  2. A product review’s star rating, one to five
  3. The date and time a post was published
  4. The number of words in a headline
  5. Minutes since the stream began

The same three checks work for data from any platform.

Which Statistics Each Level Allows

Level Summarize it with Test it with
Nominal Counts and the most common value Chi-square test of association
Ordinal The median and the ranks Rank-based tests
Interval The mean and standard deviation t-test, ANOVA, and correlation
Ratio Everything above, plus ratios between values The interval tests; you may also say one value is twice another

Definitions Practice asks for one sentence per variable that names its level and says which statistics it allows and which it rules out.

Two Tests Named in That Table

Chi-square test: a test of whether two categorical variables are associated, comparing the counts you observed with the counts you would expect if they were unrelated. Example: whether message target differs between gaming and non-gaming streams.

t-test: a test of whether the averages of two groups differ by more than chance would explain. Example: whether gaming and non-gaming chat messages differ in average length.

Measuring at a Lower Level Than Needed Limits Your Tests

  • Recording a variable as nominal when ratio was possible removes the tests that need ratio data
    • That limit is set before you code a single item
  • The problem is usually not visible while you are coding
    • It appears in November, when a test you planned is not allowed
    • By then you have already spent many hours coding

Two Kinds of Variable: Ready-Made and Coded

  • Some variables arrive ready-made in the data
    • viewers is a number, game is a category
    • Your only task is to identify the level
  • Other variables exist only after a person codes them
    • Message target (who a chat message is addressed to) is not a column in chat_log
    • It exists only after a coder reads each message and assigns a category

Coders assign categories consistently only when they follow written instructions, and the codebook is those instructions.

Exercise: Match Each Definition to Its Failure

Recap from Week 7

Each operational definition below fails in one of the four ways listed at the bottom. Name the failure for each.

  1. Community strength in a subreddit: posts per day
  2. Sincerity of a review: coded sincere when the writer means it
  3. Article quality: how many times it was shared
  4. Engagement with a video: the comment count, and nothing else

The four failures: conflating concepts, the unjustified proxy, oversimplification, and the unmeasurable definition.

Reliability Means Consistency

  • A reliable measure gives the same result under the same conditions
    • A bathroom scale that reads 150, then 162, then 147 for the same person is useless
  • In content analysis, reliability means coders apply the codebook consistently
    • It comes in two forms, on the next slide
  • Kappa and alpha measure agreement after removing the agreement expected by chance

Two Forms of Coder Reliability

Intercoder reliability: how closely two or more coders agree when each codes the same items independently. Example: two coders each label the same 100 messages without seeing the other’s codes.

Stability: how closely your own codes match when you code the same items a second time, after a gap. Example: re-coding 10 percent of the messages 48 hours later and comparing the two passes.

Validity Means Accuracy

Validity: how well a measure captures the idea it claims to measure. Example: whether counting at-mentions really captures who a message is aimed at.

Face validity: whether a measure looks, on its face, like a reasonable measure of the idea. Example: counting at-mentions to measure messages aimed at the streamer makes sense without much explanation.

Two Deeper Kinds of Validity

Content validity: whether a measure covers every part of the idea, not just some of it. Example: a message count leaves out who is talking and to whom, so it covers only part of chat engagement.

Construct validity: whether a measure behaves the way theory says the idea should, the most demanding of the three. Example: a measure of parasocial language should run higher where viewers report stronger bonds with the streamer.

You support validity with a written argument; no statistic calculates it.

Reliability and Validity Are Independent

  • Reliable but not valid: a scale that always reads ten pounds too light
    • It gives the same reading every time, and the reading is wrong every time
  • Valid but not reliable: a scale that is correct on average
    • Its readings vary so much that no single reading can be trusted

A measure must be reliable before it can be valid, but reliability alone does not make it valid. You establish reliability first, because a clear codebook is what produces it.

Writing the Validity Sentence

  • Definitions Practice asks for one validity sentence per variable
    • It says what would make you doubt the variable measures your concept
  • Name another explanation for what your number could mean
    • Message length as engagement: a long pasted block can come from a disengaged sender
    • Share count as quality: outrage articles get shared as often as good ones
  • Write the doubt, not a reassurance
    • “It measures what I say it does” states no doubt, so it does not count

A good validity sentence describes a case where the number is recorded correctly but does not reflect the concept.

Discussion: Reliability When You Are the Only Coder

Lombard et al. (2002)

“It is widely acknowledged that intercoder reliability is a critical component of content analysis and (although it does not ensure validity) when it is not established, the data and interpretations of the data can never be considered valid.”

Lombard et al. (2002, p. 589)

Your study has one coder, so intercoder reliability cannot be established. Discuss two questions:

  1. Is the quote a standard to work toward, or a verdict that your data cannot be valid? Give a reason.
  2. What can you honestly claim from one coder’s data? Name one claim you can make and one you cannot.

The Risk When the Researcher Is the Coder

“Coding must be done independently and without consultation or guidance. If possible, the researcher should not be a coder.”

Lombard et al. (2002, p. 601)

  • In your study you are both researcher and coder
    • Question: what specific risk does that create, and what would catch it? A good answer names one way your expectations could change a code and one check that would reveal it
  • A codebook pilot of about 30 units is the usual rule of thumb (Lombard et al., 2002)
  • The reliability sample you report needs at least 50 units or 10 percent of the sample, and rarely more than 300 (Lombard et al., 2002)

The Standard Two-Coder Protocol, Steps 1 and 2

When a study has two coders, the standard reliability protocol has four steps, done in this order. Your second-coder counterfactual describes this protocol.

  1. The second coder receives the codebook alone, with no explanation from you, and codes a training set of 20 to 30 units independently.
  2. The two coders compare and discuss every disagreement. No production data is coded at this stage.

In step 1 you may not explain what you meant; the codebook must work on its own.

The Standard Two-Coder Protocol, Steps 3 and 4

  1. The codebook is revised, adding a decision rule for every disagreement.
  2. The second coder codes a fresh reliability sample, separate from the training set. That agreement is the kappa you report.
  • Do not report the agreement from the training set
    • It is inflated, because the coders discussed those same units in step 2
  • Report more than one agreement statistic (Lombard et al., 2002)

Percent Agreement Alone Is Not Enough

Raw agreement: the share of items where the two passes gave the same code. Example: the two passes match on 74 of 100 items, which sounds respectable.

Chance agreement: matches that happen by luck, even when nobody follows a rule. Example: two people flipping coins to sort messages into two categories agree about half the time.

  • Do not report percent agreement by itself: kappa and alpha subtract the agreement expected by chance

Two Scores That Correct for Chance

Cohen’s kappa: a score for how much two coding passes agree beyond what luck alone would give. Example: a kappa near 0 means the passes agree about as often as luck would.

Krippendorff’s alpha: a reliability score like kappa that also works with more than two coders, ranked or numeric codes, and missing codes. Example: three coders rating how heated a message is from 1 to 5.

Which Reliability Statistic to Report

  • One approach: report one standard measure, alpha (Hayes & Krippendorff, 2007)
    • Alpha works with any number of coders, any level of measurement, and missing codes
  • Another approach: report two or more statistics, with a decision rule (Lombard et al., 2002)
    • Accept when a conservative statistic reaches a moderate value or a liberal one reaches a high value
  • Your protocol names the statistic you will report and explains why you chose it

Reliability Thresholds

  • State your threshold, with its source, before you compute the statistic
    • Kappa of 0.70 or higher is the course floor (Landis & Koch, 1977)
    • 0.90 nearly always acceptable, 0.80 in most situations, 0.70 in some exploratory studies (Lombard et al., 2002)
    • Alpha of 0.80, or 0.667 for tentative conclusions (Krippendorff, 2018)
  • If the result is below your threshold, revise the codebook; a caveat is not enough

Two passes that agree on 40 of 50 units have 80 percent agreement. That is not kappa, so compute kappa before comparing the result with the 0.70 floor.

Reliability Sample Size and Computing Kappa

  • The reliability sample needs at least 50 coded units
    • If some categories are rare, 100 or more units are preferred
  • v2v::reliability() computes kappa and labels its strength, such as “substantial”

The One-Coder Protocol You Will Run

You have no second coder, so you report stability (intracoder reliability), and your protocol uses that word.

  1. Re-code at least 10 percent of your coded items, 48 hours or more later, with your first codes hidden
  2. Draw that sample fresh, at random from items you did not use to build or revise the codebook
  3. Report the statistic even if it is lower than you hoped, with the revision rule you would apply
  4. Name three safeguards against your coding drifting over time, and write the second-coder counterfactual

Stability Compared with Two-Coder Agreement

In this course, 10 percent is enough to practice; published studies re-code 10 to 20 percent.

Stability is weaker evidence than agreement between two coders. Following the four steps of the one-coder protocol makes your stability report honest.

If Your Reliability Falls Below the Threshold

  • Write your revision rule now, before you see the number
    • The rule says which categories you will revise and how
  • Use the list of items your two passes coded differently
    • For each one, rewrite the codebook rule that failed to decide it
    • Do not settle a disagreement by re-reading your first codes and going with your feeling
  • Keep a record so the codebook does not drift toward your habits
    • Log every change with its date and reason
    • Re-code the affected items under the new version
  • Report the first number anyway, and explain what it showed you about the codebook

Five Safeguards: Use at Least Three

Your protocol names at least three of these that you actually use, and describes what you do for each.

  1. Inclusion and exclusion rules for every category, written before coding begins
  2. Prototypical examples, two or three per category, drawn from your corpus
  3. A frozen codebook, with every later change logged by date and reason
  4. An ambiguous-case memo, decided by the written rule rather than by feel
  5. A fixed coding order, with source details such as the account name hidden wherever possible

The Second-Coder Counterfactual

Write one paragraph describing how you would have measured reliability with a second coder. It covers four points.

  1. How many items you would have double-coded
  2. Which statistic you would have reported
  3. How you would have trained the second coder and settled disagreements
  4. Which finding is most at risk if the second coder had disagreed with you

Points 1 to 3 come from the standard two-coder protocol earlier in this deck. Point 4 asks you to judge which of your own findings depends most on your coding.

Why a Reliability Protocol Is Required

“Conclusions from such data can be trusted only after demonstrating their reliability.”

Hayes and Krippendorff (2007, p. 77)

  • Either protocol, two-coder or one-coder, provides the demonstration this quote requires
  • Every later analysis depends on the codes being reliable
  • A finding from a codebook whose reliability was never tested has no support

The Codebook Is Your Measuring Instrument

  • The codebook is not paperwork written to satisfy a requirement
  • If coding were a computer program, the codebook would be its source code
    • It specifies every step and every if-then decision
    • Run on the same input twice, it gives the same output
  • The codebook is the core of a content analysis (Neuendorf, 2017)

Five Parts of a Codebook

  1. Unit of analysis: exactly what one coded case is
  2. Variables and categories: the conceptual and operational definition of each variable, and every value it can take
  3. Decision rules: what to do when a case does not fit one category cleanly
  4. Examples: two or three prototypes per category, from your own material
  5. Special cases: complications that keep recurring; this section starts short and grows as you code

Categories Must Be Exhaustive and Mutually Exclusive

Exhaustive: every case can be given one of the variable’s values, with no case left over. Example: an “unclassifiable” value catches any message the other values miss.

Mutually exclusive: every case fits exactly one value, never two. Example: a message cannot be coded both “directed at the streamer” and “broadcast to the room.”

Keeping Both Rules

  • A catch-all category, such as “unclassifiable,” guarantees exhaustive coding
    • If more than 10 percent of cases land in it, the categories are incomplete and need revision
  • If categories overlap, coders keep disagreeing on the same cases, and reliability drops
  • To fix overlap, sharpen the definitions or add a precedence rule that says which category wins

Example Codebook: Unit and Message Target

Unit of analysis. A single chat message, defined as one row of chat_log: one sender, one message string, one timestamp. Each message is coded independently of those around it, except where a decision rule says otherwise.

Variable 1: message target. Categories: directed at streamer, directed at another viewer, broadcast to the room, unclassifiable. Level: nominal.

Example Codebook: Message Length and Emotes

Variable 2: message length. Conceptual: the verbal extent of the message. Operational: the count of characters, including spaces and emote tokens. Counted, not judged by a coder. Level: ratio.

Variable 3: contains emote. Operational: yes if the message contains at least one token from the project’s emote list. Level: nominal.

Message length and contains emote are manifest: anyone can count them. Message target is latent: a coder must interpret it. The example mixes both kinds on purpose.

The Example Codebook’s Five Decision Rules

  1. Precedence: a message that directly addresses someone is coded as directed at them, even if it also plays to the room
  2. Emote-only messages: coded broadcast to the room, unless the message includes an @-mention
  3. Copypasta (a block of text many viewers paste): coded by its content, like any other message
  4. Messages not in English: code the target only when the message’s structure, such as an @-mention, shows it
  5. Bot accounts: coded unclassifiable and flagged for possible exclusion

Exercise: Sort Rules from Intentions

A rule is an instruction a coder can apply without asking you. An intention is a wish that leaves the decision to the coder. Label each item below a rule or an intention.

  1. Be careful with sarcasm
  2. A message made only of emotes is coded broadcast to the room
  3. Use judgment on posts in a language you do not read
  4. A reply that quotes an earlier comment is coded directed at another viewer

Definitions Practice asks for two decision rules per variable. An intention written in place of a rule earns no credit.

Definitions Practice: The Six Required Elements, 1 to 3

Due Monday, October 19, 11:59 PM. Define at least four variables, and give each one all six elements, written the way they will appear in your codebook.

  1. Conceptual definition, with a citation to where the construct comes from
    • If you invented the construct, add a sentence explaining why it is needed
  2. Operational definition: the steps a coder performs to assign a value, not the conceptual definition reworded
  3. Level of measurement, with one sentence on which statistics it allows and which it rules out

Definitions Practice: The Six Required Elements, 4 to 6

  1. Coded values: every value, what each means, and a catch-all category
  2. Two decision rules for edge cases, each written as a rule a coder can apply
  3. One validity sentence: what would make you doubt the variable measures your concept

Before Week 9

  • Read Chapter 9, and bring a laptop with R installed
    • Re-read Munafo et al. (2017) on reporting and usability
  • Due Monday, October 19, 11:59 PM: Definitions Practice
    • Run it through Codebook Check on the Hub before you submit
  • Due Monday, November 2, 11:59 PM: Extended Codebook and Reliability Protocol
    • It includes your planned sample size, thresholds, and revision triggers
    • Have three variables written out with their decision rules
  • Time your first twenty coded items; Week 10 uses that rate to set your sample size
  • Write a journal entry, 450 to 500 words

Questions, Comments, or Concerns?