06.5.5 · Skill in Statistical reasoning

Sampling and selection bias

When the data comes from a group that does not represent everyone.

Survey respondents, power users and early adopters are not typical users. Survivorship bias, such as only studying users who stayed, is common in product data. Asking who is missing from the data prevents many wrong conclusions.

Your status · Sampling and selection bias

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

Why it matters for a product engineer

Data comes from the people who were there to be measured. Survey respondents, power users and customers who stayed are easy to study, and they are not typical. A product engineer who asks who is missing from the data avoids building only for the most visible group.

How to do it

  1. Before the analysis, write down who could appear in the data, and who could not.
  2. Compare the sample with your whole user base on a few known facts, such as plan, country and activity.
  3. Look for survivorship. People who left, failed at signup or never installed are not in your user data.
  4. When the sample is skewed, weight the results or report them per segment.
  5. Recruit from more than one channel when you can.

Common mistakes

  • Believing that a big sample is a representative one.
  • Studying only retained users to explain retention.
  • Treating requests from power users as everyone’s needs.
  • Survey results reported without the response rate or the recruiting channel.

Example

Stack Overflow’s 2024 Developer Survey used 65,437 responses from 185 countries. Its methodology note says that respondents were recruited mainly through Stack Overflow’s own channels: messages on the site, blog posts, the newsletter, banner ads and social media posts. So highly engaged users of the site were more likely to see the invitation. The note states this bias openly, which lets readers judge how far the results apply to developers who rarely visit the site.

Flow

Who was likely to answer Stack Overflow's survey

Site messagesOn Stack OverflowOwn channelsBlog, email, ads, socialEngaged usersMore likely to see itResponses65,437 usedSite messagesOn Stack OverflowOwn channelsBlog, email, ads, socialEngaged usersMore likely to see itResponses65,437 used

The invitations went out mainly through Stack Overflow's own channels, so the most active users of the site were the most likely to answer.

ReportedStack Overflow, 2024 Developer Survey methodology

Sources: Methodology, 2024 Developer Survey (Stack Overflow) ↗ · How survivorship bias affects your analysis (Data School) ↗

Resources

1

Tools

1
Tools for Statistical reasoning