Skip to content
Tutorials Center
My learning

Topics

Lesson 31 of 37 ยท Sampling and Inference Basics

Populations, Samples and Sampling Methods

Understand parameters vs statistics, simple random, systematic, stratified, cluster and convenience sampling, and how bias spoils a sample.

Usually you cannot measure everyone. A factory cannot test every battery to destruction, and a poll cannot ask every voter. Instead you study a smaller group and use it to learn about the larger one. This is the heart of inference, and everything depends on how the small group is chosen.

Vocabulary

  • Population: the entire group you want to learn about (all students at a school, all bulbs from a factory this month).
  • Sample: the part of the population you actually measure.
  • Parameter: a number describing the population, such as the true mean ฮผ or true proportion p. Usually unknown.
  • Statistic: a number computed from a sample, such as the sample mean xฬ„ or sample proportion pฬ‚. It is used to estimate a parameter.
  • Sampling frame: the list from which you draw the sample.

A census measures the whole population. A sample is cheaper and faster, but its statistic will vary from sample to sample: that variation is called sampling variability.

Random sampling methods

Method How it works Good for
Simple random Every individual (and every group of size n) has an equal chance Basic, unbiased choice
Systematic Pick a random start, then every k-th item Ordered lists, production lines
Stratified Split into groups (strata), sample from each in proportion Making sure subgroups are represented
Cluster Randomly choose whole groups (clusters) and measure everyone in them Spread-out populations, e.g. schools

Example: to survey 200 of a school's 1,000 students, with 600 in the lower school and 400 in the upper, a stratified sample takes 120 from the lower and 80 from the upper, each chosen randomly.

Python Draw samples four different ways

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The true share of upper-school students is 0.40. The stratified sample hits it exactly by design; the others vary.

Non-random methods and bias

  • Convenience sampling: ask whoever is easy to reach. Often unrepresentative.
  • Voluntary response: people choose to respond (online polls, call-in shows). Usually attracts people with strong opinions.
  • Bias means the method systematically favors some outcomes. Types include selection bias (the sample does not represent the population), non-response bias (the people who refuse differ from those who answer), and response bias (leading or embarrassing questions).

A famous cautionary example is large polls that were skewed because their frame (for instance, telephone or magazine lists) systematically left out groups of voters. A huge biased sample is worse than a small random one.

Python Bias versus randomness: a simulated experiment

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

This population is simulated, not real data. The biased sample overshoots no matter how many people you add, whereas the random sample is off only by chance.

Increasing the sample size reduces random error, but it cannot fix bias.

Designing a good survey

  1. Define the population and the question clearly.
  2. Build a sampling frame that covers the population.
  3. Choose a random method and a sample size.
  4. Write neutral questions ("How satisfied are you with the cafeteria?" not "Don't you agree the cafeteria is awful?").
  5. Follow up non-respondents and report the response rate.

Next you will see how sample statistics behave when many samples are taken, in sampling distributions.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. The average height of all 600 players in a league is 182 cm. This number is a...

    It describes the whole population, so it is a parameter.
  2. 2. A school has 700 girls and 300 boys. A stratified sample of 100 students by gender should contain...

    Stratified sampling keeps the sample proportions equal to the population proportions.
  3. 3. An online poll invites anyone to vote. This is most likely...

    People self-select, and those with strong opinions are more likely to respond.
  4. 4. Which statement about sample size is true?

    Bias comes from the method, so a bigger biased sample is still biased.

Summary

  • A population has parameters; a sample has statistics that estimate them.
  • Random methods: simple random, systematic, stratified and cluster.
  • Convenience and voluntary samples are prone to bias.
  • A larger sample reduces random error, not bias.

Next: Sampling Distributions and the Central Limit Theorem