Zum Inhalt springen

Lektion 15 · Uncertainty and Sampling

Sampling: Learning From a Part

Understand populations, samples and sampling frames, random, stratified, cluster and convenience sampling, and why bigger is not always better.

You rarely get to measure everyone or everything. A factory cannot test every light bulb until it breaks, and a researcher cannot interview a whole country. Instead you measure a sample and use it to learn about a larger group. Done well, a few thousand observations can tell you a lot. Done badly, millions of observations can mislead.

The key words

From target to answers

Population Everyone you care about
Frame The list you draw from
Sample Those you select
Respondents Those who answer
1 / 2
  • The population is the whole group you want to learn about, such as all customers who ordered this year.
  • The sampling frame is the list or method you actually draw from, such as your email database.
  • The sample is the set you select.
  • Respondents are those who actually take part.

Each step can lose or distort part of the population. If your frame is the email list, customers without email can never be chosen.

A parameter is a true value for the population, such as its average order value. A statistic is the value computed from the sample. The statistic is your estimate of the parameter.

Why randomness helps

In a simple random sample, every possible group of a given size from the frame is equally likely to be chosen, so every member has the same chance. Randomness does not guarantee a perfect copy of the population, but it avoids systematic favoritism, and it lets you calculate how much results might vary by chance.

Python Random samples vary

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.

Small samples tend to jump around. Larger random samples tend to cluster closer to the truth. Run it again with a different seed number.

Other sampling methods

Method How it works Good for Risk
Simple random Draw from the full list at random A clean baseline Small groups may be missed
Stratified Split into groups, sample from each Making sure each group appears Needs group information
Systematic Every k-th item after a random start Easy on lists or lines Hidden patterns in the order
Cluster Pick whole groups at random, such as schools Cheaper field work Members of a group may be alike
Convenience Whoever is easy to reach Quick pilot ideas Often unrepresentative
Volunteer People opt in Collecting comments Strong views are over-represented

In stratified sampling you may deliberately sample a small group more heavily so that you have enough data about it. Then you weight the results so each group counts in proportion to its true share.

Python Weighting a stratified sample

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.

Without weighting, premium customers count far too much, and the satisfaction figure looks better than it is.

Size is not everything

A large sample reduces random variation. It does not fix a biased method. If you only survey people who visit your store on weekday mornings, asking 100,000 of them still tells you little about weekend shoppers.

For a good random sample from a large population, the precision depends mainly on the number of people sampled, not on the fraction of the population. That is why a well-run national poll can use a sample that is a tiny share of the country. The difficulty is making the sample truly representative.

Practical steps

  1. Define the population precisely.
  2. Check how well the frame covers it and who is missing.
  3. Choose a method with a random element where possible.
  4. Decide the sample size from the precision you need and your budget.
  5. Plan follow-ups, because non-response matters.
  6. Report how the sample was selected and how many took part.

To learn the methods in more depth, see the sampling methods lesson.

When you can measure everyone

If you have every record, such as all of this month's invoices, you have a census of that period and no sampling error. But if you use it to predict next month, you are again generalizing, and the usual cautions return.

Worked example: choosing a method

A city library wants to learn how satisfied its members are. It has 12,000 members, and about 1,500 of them visit the smallest branch. A manager suggests handing out forms at the main entrance on Saturday morning.

That is a convenience sample. It reaches only Saturday visitors at one branch, and members who rarely visit have almost no chance. A better plan is to take the full membership list as the frame, split it by home branch, and draw a random sample from each branch. The small branch then gets enough replies to be described on its own. When you combine the results, weight each branch by its share of all members.

Next, plan for people who do not answer: send one reminder, offer a paper option for members without email, and compare the age and branch of those who reply with the full list. If young members rarely answer, say so when you report the results. No plan is perfect, but this one tells you who could have been chosen and who is likely to be missing.

Practice

Which method is being used? An inspector checks every 50th box after a random first box. A researcher picks 10 schools at random and surveys every student in them. A blogger asks followers to vote.

Answers: these are systematic, cluster and volunteer sampling. For the inspector, ask whether a fault could repeat every 50 boxes, perhaps from one nozzle of a machine. For the schools, remember that students in the same school may resemble one another, so 10 schools give less independent information than the number of students suggests. For the blog vote, report it as the views of those who voted and nothing wider.

Common mistakes: calling a self-selected online poll "what people think"; treating a huge sample as automatically fair; sampling from a list that misses part of the population; and mixing up the sample with the population.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. A company surveys customers by drawing names from its newsletter list, but wants to know about all customers. What is the newsletter list?

    It is the list used to draw the sample. It may not cover all customers.
  2. 2. Which method makes sure that every region appears in the sample?

    Stratified sampling draws from each group deliberately.
  3. 3. An online poll has 200,000 voluntary votes. What is the main concern?

    Self-selection creates bias that size cannot remove.
  4. 4. Why might you weight a sample?

    Weighting corrects known imbalances in the sample's makeup.

Summary

  • Samples estimate facts about a population through a sampling frame.
  • Random selection avoids systematic favoritism.
  • Stratified, cluster, systematic, convenience and volunteer methods differ in risk.
  • Weighting can correct known imbalances.
  • Bigger samples reduce chance variation but not bias.

Next: Bias in Data

Dein Fortschritt wird in diesem Browser gespeichert. Kein Konto nötig.