The Sample

S19 · Chapter 10

Today’s Agenda

  • A recap: what a variable is
  • Why coding every message (a census) is not an option
  • What simple random sampling can and cannot fix
  • Strata: dividing the population into groups, and choosing groups that matter
  • Drawing the sample so that anyone can reproduce it

What a Variable Is

Recap from Session 9

Variable: something about a case that can change from one case to the next, where a case is one thing you study, such as one chat message.

  • A column in the data: game says Fortnite for one stream and Just Chatting for another
  • A category you code: message target, where you decide if a message speaks to the streamer, to another viewer, or to the whole room
  • A number you count: messages a channel posted that week, one for the quietest example channel and about 1,440 for the middle one

Your codebook is a list of variables. Today you choose which messages to code them on.

Coding by Hand Takes Four Hundred Hours

Coding: reading one item and writing down its value for each variable, following your codebook’s rules. Example: reading a message and marking it “directed at the streamer.”

  • Coding one message by hand takes about forty-five seconds
    • The 35,267 messages in the example working sample would take over four hundred hours
    • The full 2018 collection would outlast your degree
  • So you will code a sample, not the whole set
  • Time your own coding on a few items, then multiply by the number of items in your source

Population and Sample

Population: every case your conclusions are about. Example: every message posted in the fifty example channels that week.

Sample: the smaller set of cases you actually look at. Example: thirty messages from each of those fifty channels.

  • In your study, the population is whatever your prospectus named

Today is about how to draw that sample well.

Census

Census: looking at every case in the population, which works only when the population is small. Example: the example stream table keeps all of its roughly 32,000 snapshots.

  • A snapshot is one record of one stream at one moment: its title, its game, its viewer count, and the date
  • A census needs no sampling plan, because nothing is left out

The Chat Table Is the Opposite Case

  • There is far too much chat to code, so a census is impossible
    • Most content analysis studies face the same problem
  • A sample makes the work finite without making the conclusions worthless
  • A sample of any size can be sound or misleading
    • 1,500 messages or 250, the sampling method decides which

You choose the sampling method, and the method decides whether the sample is sound.

Simple Random Sampling

Simple random sampling: every message has the same chance of being picked, like drawing names from a hat. Example: R picks 1,000 messages from the whole chat table at random.

Unbiased: the way you pick favors no message over any other. Example: a message from a quiet channel has the same chance as one from a giant channel.

  • Being unbiased is a real guarantee, and for the example data it is not enough

Why Equal Chances Are Not Enough

  • Chat volume is heavily concentrated in a few channels
    • Busiest channel: more than a million messages that week
    • Median channel (the middle one when all fifty are lined up by size): about 1,440 messages
    • Quietest channel: one message

Right-skewed: most values are small and a few are huge, so a chart of them has a long tail to the right. Example: a few giant channels and a long, thin tail of small ones.

Draw at random and almost every message comes from the giants.

Biased Versus Representative

Biased: a way of picking that favors some cases over others. Example: keeping only the messages that made you laugh.

Representative: a sample that gives a fair picture of every group your question is about. Example: a sample with enough Bob Ross messages to say something about non-gaming chat.

  • A sample can avoid one problem and still have the other

Exercise: A Random Draw From the Example Data

  • The quietest example channel posted one message all week. If you draw 1,000 messages at random, would you expect that channel to show up at all? Why or why not?
  • Is that sample biased? Is it representative? Answer each separately, with one reason
  • If your own study compares two groups, name the group that is rarer in your source

The Second Dimension: Gaming and Non-Gaming Channels

  • Forty-three of the fifty example channels are gaming channels
    • Bob Ross’s painting channel is the clearest exception
  • A random sample would be almost all gaming chat
    • Not because the draw is biased, but because that is where the messages are
  • For a study comparing gaming and non-gaming chat, a random draw is close to fatal

Unbiased and Still Unrepresentative

  • A random sample copies the population’s imbalance into a smaller set
  • A comparison needs enough cases from every group being compared
  • Unbiased is a property of the procedure, not a guarantee about the result

Check your population for this imbalance before you draw the sample.

Stratified Sampling

Stratified sampling: split the population into groups, called strata (one group is a stratum), then draw from each group separately. Example: draw thirty messages from each of the fifty channels.

  • Do not draw from one undifferentiated pool
  • Every stratum gets a place in the sample
    • In the proportion you decide, not the proportion the population hands you

Choosing Strata That Matter

  • Strata follow the research question, not convenience
    • For the example chat study the stratum is the channel
    • A fixed number of messages per channel admits the small channels fully
  • Whether a channel is a gaming channel is a property of the channel
    • So stratifying by channel rescues the gaming versus non-gaming comparison
    • Every non-gaming channel is in the sample by construction
  • For your own source, the stratum is whatever group your question compares: an account, a subreddit, a month, an outlet

The Example Corpus Is Itself Stratified

  • The fifty channels were not the fifty busiest
    • Eight were fixed anchors: channels picked on purpose for variety
    • Bob Ross was one of them, the deliberate non-gaming case
  • The other forty-two came from ten volume bands, and every band was sampled
    • A volume band is a group of channels with similar amounts of chat
  • The skew is kept: small, middle, and giant channels are all in the corpus
  • How the corpus was built: Chapter 10, Stratified sampling

When a Stratum Is Too Small

  • If you ask for thirty messages from a channel that produced nine, the tools take all nine
  • Nineteen of the fifty example channels hold fewer than a thousand messages, and a few hold only a handful
  • A stratum contributes either its full share or everything it has

Drawing the Sample

set.seed(409)

coding_sample <- chat %>%
  group_by(channel) %>%
  slice_sample(n = 30) %>%
  ungroup()
  • group_by(channel) treats each channel as a stratum
  • slice_sample(n = 30) asks for thirty messages from each channel
    • Across the fifty channels, this draw returns 1,350 messages
  • set.seed(409) fixes the random draw so it can be repeated
  • 1,350 messages is a size for a team of coders; your draw uses the same lines with your own stratum column and number (Chapter 10, Drawing the sample)

Sizing the Draw to Your Time Budget

  • At 45 seconds a message, 1,350 messages take nearly seventeen hours
  • Lower the n in slice_sample() until the arithmetic fits the time you have
    • n = 5 across fifty channels is 250 messages, about three hours
    • The sample is still stratified, so the comparison still holds
  • Write the arithmetic into your sampling plan: seconds per item, number of items, total hours

Why the Seed Is Not Optional

Seed: a number that fixes a random draw so it comes out the same every time. Example: set.seed(409) gives you the same 1,350 messages on every run.

  • A random draw differs every time you run it
  • The seed fixes the starting point of R’s random number generator
    • set.seed() must run right before the draw, every time
  • Without a seed, nobody can check your results, including you in six months

The Seed Itself Is Arbitrary

  • The number 409 means nothing
  • What matters is that a seed is set
  • And that it is recorded in your sampling plan

Unit of Analysis and Key

Unit of analysis: the one kind of thing each row of your coding sheet describes. Example: one chat message, or one TikTok video.

Key variable: a column two tables share, used to match their rows. Example: the song title links a Spotify table to a table of TikTok videos.

One Codebook or Two?

  • Write one codebook per unit of analysis, not one per platform
  • Different units, different codebooks, joined by a key variable
    • Spotify numbers and TikTok videos: a song and a video, linked by the song
    • Box office and reviews: a film and a review, linked by the film
  • Same unit on every source: one codebook, with a source variable
  • The codebook template’s linking section records the key and how records match: codebook template

Looking Ahead to Thursday

  • Today showed how to draw a sample; Thursday tests your draft codebook on items from it
  • Thursday is the pilot: ten to twenty items coded twice, with your first codes hidden
  • Cohen’s kappa: a score for how much your two coding passes agree beyond what luck alone would give
  • Read the second half of Chapter 10 before Thursday
  • Bring your draft codebook, because it is the thing being tested
  • Due Friday, October 30, 11:59 PM: Codebook and Qualitative Memo
  • Due Friday, November 6, 11:59 PM: Sampling Plan and Pilot
  • Check yourself on this week’s terms: Week 10 self-check, ungraded, with the answer after each question

Questions, Comments, or Concerns?