Samples, bias, and choosing the right average
What this lesson covers
- It is not always possible to get data from the entire population (as in a census). To make inferences about a population without a census, sampling is used.
- Samples must be taken randomly from the population, otherwise there will be bias in the data, leading to inaccurate and misleading statistics. Samples are ideally chosen using simple random sampling, in which each item of the population has an equal probability of being chosen.
- When sampling from a population, the distribution for a variable varies from sample to sample. To make a reliable inference about what is happening in the population, sample sizes need to be: about 1,000 for categorical variables (with the sample obtained using technology) at least 30 for numerical variables.
Every statistic is about people nobody asked
- A headline says forty percent of New Zealanders think something.
- Nobody asked five million people. They asked about a thousand.
- This lesson is about when that is allowed.
Why not just ask everyone?
- Asking everyone is a census, and New Zealand runs one.
- It costs millions and takes months, for one set of questions.
- So for anything else, you ask some and infer the rest.
| Approach | Detail | Cost |
|---|---|---|
| A census asks everyone | New Zealand does one | every five years |
| It costs | many millions | and takes months |
| For one question | that is not possible | |
| So you ask some | and infer the rest |
The thing that ruins a sample
- A biased sample is one that does not look like the population.
- Ask people leaving a gym how often they exercise.
- You will get an answer, and it will be confidently wrong.
| Problem | Example |
|---|---|
| A biased sample | does not look like the population |
| Asking at a gym | about exercise habits |
| Asking online | about internet access |
| The answer is wrong | and looks perfectly convincing |
Try it: random or biased?
It is usually not obvious
- An online poll about internet access misses everyone without it.
- A phone survey at 10am misses everyone at work.
- The question is always: who could not have been chosen?
What random actually means
- Every single member of the population is equally likely.
- The test: could any one of them have ended up in your sample?
- Whoever happened to be nearby fails that test immediately.
| Rule | In practice | Note |
|---|---|---|
| Simple random sampling | everyone equally likely | |
| The test | could any person | have been chosen? |
| Whoever is nearby | fails that test | |
| Use a random generator | not your judgement |
Doing it properly
- Number the population, then use a random number generator.
- Not your own choosing. People are terrible at being random.
- The technology is free and it is the whole of the method.
How many do you need?
- For a categorical variable, around a thousand.
- For a numerical one, at least thirty.
- A category carries less information per person, so you need more.
| Variable | Sample size |
|---|---|
| Categorical variable | about 1 000 |
| Numerical variable | at least 30 |
| Why the difference | a category carries less information |
| Biased and big | is still biased |
Big does not fix biased
- A biased sample of ten thousand is not better than one of thirty.
- It is worse, because it looks more convincing.
- Size reduces variation. It does nothing at all to bias.
Two fair samples will still disagree
- Take a proper random sample. Then take another one.
- They will not give identical answers, and neither is wrong.
- That spread is sampling variation, and bigger samples vary less.
| Step | Result | Name |
|---|---|---|
| Take a sample | get a result | |
| Take another | slightly different | |
| That spread | is sampling variation | not error |
| Bigger samples | vary less |
Try it: test the sample
Collecting more than one thing
- Record height, and you can describe how tall people are.
- Record height and arm span for each person, and you can ask more.
- They have to be recorded together, or the link is gone.
| What you collect | What you can ask | Note |
|---|---|---|
| One variable | how tall are they | |
| Two at once | height and arm span | per person |
| Now you can ask | are they related? | |
| Record them together | or the link is lost |
Write the question before you collect anything
- Who exactly is the population? All Year 10s, or this school?
- What are you measuring, and in what units?
- Data collected without a question answers nothing in particular.
| Do this | Not that |
|---|---|
| Write the question first | then design the collection |
| Who is the population? | all Year 10s? this school? |
| What will you measure? | and in what units? |
| Data collected first | answers nothing in particular |
Two averages, one set of numbers
- Two, three, three, four, and forty-eight.
- The mean is twelve. The median is three.
- Four of the five values are below the mean.

So which one should you report?
- If the data has a long tail one way, use the median.
- If it is roughly symmetric, the mean is fine and says more.
- Ask what the average is meant to represent.
| Shape of the data | Use |
|---|---|
| A long tail one way | use the median |
| Roughly symmetric | the mean is fine |
| House prices, incomes | always reported as medians |
| Because a few very large ones | drag the mean up |
Try it: mean or median?
Which is why you never see a mean house price
- House prices and incomes both have a long tail upwards.
- A few very large ones would drag the mean well above typical.
- So they are reported as medians. Check tonight. They always are.
What to take away
- Seven lines, and the third one is the one people forget.
| A sample is a claim | about people you did not ask |
| Random means | everyone equally likely |
| A biased sample | is wrong at any size |
| Categorical | about 1 000 |
| Numerical | at least 30 |
| Samples vary | and that is expected |
| A long tail | means report the median |
Common mistakes
- A survey of 10 000 people leaving gyms must be reliable because it is so big.Size reduces variation but not bias: everyone leaving a gym exercises, so it overstates exercise however many are asked.
- For 2, 3, 3, 4, 48 the mean of 12 is the typical value.Four of the five values are below 12 because the 48 drags the mean up, so the median of 3 describes the data better.
- I chose people who looked different from each other, so my sample is random.Random means everyone is equally likely to be chosen: number the population and use a random number generator, not your judgement.
- 30 people is enough to estimate the percentage who prefer a brand.A preference is a categorical variable, which needs around 1 000; at least 30 is the guide for a numerical variable.
Your turn: eight questions
- Answer all eight.
- Question 1 wants the reason, not just the word.
- Question 4 follows from your answer to question 3.
A gym exit survey on exercise. Problem?
Minimum sample size, numerical variable?
For 2, 3, 3, 4, 48: mean and median?
Which of those describes the data better?
Hemi wants a sample of 50 of the 800 students at his Hamilton school. Which method is simple random sampling?
A radio phone-in poll gets 5,000 texts. A council asks a random sample of 1,000 residents. Which result should you trust more?
You want to find out whether arm span is related to height in Year 10 students. How must you collect the data?
The 100 m times of 30 students are roughly symmetric, with no long tail. Which average should you report, and why?
Show answer
1. The sample is biased. Everyone leaving a gym exercises, so the sample cannot represent a population that includes people who do not. The result will overstate exercise however many people are asked. 2. At least 30. For a categorical variable you would want around 1,000. 3. The mean is 12, because the five values total 60. The median is 3, the middle value when they are in order. 4. The median. Four of the five values are below the mean, so the mean is not describing a typical value at all: it has been dragged up by the 48 on its own. 5. Number all 800 students and let a random number generator pick 50. Only then is every student equally likely to be chosen. 6. The random 1,000. Phone-in texters choose themselves, so that sample is biased, and a biased sample stays biased however big it is. 7. Record both measurements for each student, together. If heights and arm spans are collected separately, the link between them is lost. 8. The mean. With roughly symmetric data the mean is fine and uses every value; the median is only needed when there is a long tail.
The answers
- It is biased: everyone leaving a gym exercises.
- At least thirty for a numerical variable.
- Mean twelve, median three.
- The median, because the mean sits above four of the five values.
Center and Variability

Full screen · PhET Interactive Simulations, University of Colorado Boulder, CC BY 4.0
Challenge
A small town has 4,000 adults. 1,000 of them have no internet at home. A council plan is supported by 30% of the adults who have internet and by 70% of those who do not. (a) What percentage of all the town's adults support the plan? (b) The council runs an online poll of 1,000 randomly chosen internet users. About what result should it expect? (c) A councillor says: 'Then let us poll all 3,000 internet users, so the result is certain.' What result would that give, and what is wrong with the councillor's idea? (d) What result should a properly random sample of 1,000 of all the town's adults give, roughly?
Hint
Work out how many people in each group support the plan, then add. For the online poll, ask: who could never have been chosen?
Answer
(a) 40%. (b) About 30%. (c) Exactly 30%, still 10 percentage points too low: a bigger sample does not fix a biased one. (d) About 40%, give or take a little through sampling variation.
Step by step
- Find the number of supporters in each group and add them, then divide by everyone.
- An online poll can only ever choose people with internet, so it estimates the internet users' 30%, not the town's figure.
- Asking all 3,000 internet users removes sampling variation but not the bias: the 1,000 people without internet still could not be chosen.
- A random sample of all adults gives everyone an equal chance, so it should land near the true 40%, though two such samples would differ slightly.
Full working
- internet supporters = 30% × 3,000 = 9004,000 − 1,000 = 3,000 with internet
- non-internet supporters = 70% × 1,000 = 700the group the poll misses
- town support = (900 + 700) ÷ 4,000 = 40%all supporters over all adults
- online poll estimates internet users onlyabout 30%
- poll all 3,000 users: exactly 900 ÷ 3,000 = 30%no variation, same bias
- error = 40% − 30% = 10 percentage pointsbias does not shrink with size
- (a) 40% (b) about 30% (c) 30%, still biased (d) about 40%
Five positive whole numbers have a median of 3 and a mean of 12, just like the set 2, 3, 3, 4, 48. Their mode is 3, and no other number appears as often as 3 does. (a) What is the largest possible value of the biggest number? (b) What is the smallest possible value of the biggest number? Give a set of five numbers for each.
Hint
The five numbers add to 5 × 12. In order, the middle one is 3. To make the biggest number large, make the others as small as the rules allow; to make it small, make the others as large as the rules allow. Watch the mode rule.
Answer
(a) 51, from 1, 2, 3, 3, 51. (b) 26, from 3, 3, 3, 25, 26.
Step by step
- A mean of 12 for five numbers means they total 60, and the middle number in order is 3.
- For a big largest number, the other four must be small. The two smallest are at most 3, and 3 must appear more often than anything else.
- 1, 1 is not allowed, because 1 would then tie with 3 as a mode. So use 1, 2, then 3, 3, which leaves 51 for the largest.
- For a small largest number, the two smallest should be as big as possible: 3 and 3. Then 3 appears three times, and the last two must share 60 − 9 = 51.
- Sharing 51 as evenly as possible gives 25 and 26, and neither ties with 3 as a mode.
Full working
- total = 5 × 12 = 60mean × count
- in order: a, b, 3, d, e with a ≤ b ≤ 3 ≤ d ≤ emedian is the middle value
- largest e: a = 1, b = 2, d = 3smallest values that keep 3 as the only mode
- e = 60 − (1 + 2 + 3 + 3) = 51the rest goes to e
- smallest e: a = b = 3largest values allowed below the median
- d + e = 60 − 9 = 51, so d = 25, e = 26share as evenly as possible with d ≤ e
- (a) 51 from 1, 2, 3, 3, 51 (b) 26 from 3, 3, 3, 25, 26
Two Year 10 classes at a Christchurch school record their screen time last weekend, in hours. Class A has 20 students with mean 15 and median 12. Class B has 30 students with mean 20 and median 21. (a) Find the mean for all 50 students together. (b) Rawiri says the median for all 50 is just (12 + 21) ÷ 2 = 16.5. Using two tiny made-up pairs of groups of 3 people each, show that two groups can have the same two medians but different combined medians, so Rawiri's method cannot work. (c) Which class's screen times probably have a long tail, and in which direction? Which average would you report for that class, and why?
Hint
For the combined mean, find each class's total first. For (b), try groups whose medians are 2 and 5, and change only one number in the second group. For (c), compare each class's mean with its median.
Answer
(a) 18 hours. (b) For example 1, 2, 3 with 2, 5, 6 gives a combined median of 2.5, but 1, 2, 3 with 4, 5, 6 gives 3.5, although the medians are 2 and 5 both times. (c) Class A: its mean (15) is well above its median (12), so a few students with very high screen time form a long tail upwards. Report its median, 12 hours.
Step by step
- A combined mean is the combined total divided by the combined count, not the average of the two means, because the classes are different sizes.
- A median only depends on the middle value, so it hides where the other values sit.
- Two pairs of groups with the same medians can still have different middle values once they are merged, which is all a counterexample needs.
- A mean well above the median means a few large values are dragging it up: a long tail upwards.
- With a long tail, the median describes a typical student better.
Full working
- Class A total = 20 × 15 = 300 hoursmean × count
- Class B total = 30 × 20 = 600 hoursmean × count
- combined mean = (300 + 600) ÷ 50 = 18 hoursnot (15 + 20) ÷ 2 = 17.5
- 1, 2, 3 and 2, 5, 6: medians 2 and 5; merged 1, 2, 2, 3, 5, 6, median (2 + 3) ÷ 2 = 2.5first pair
- 1, 2, 3 and 4, 5, 6: medians 2 and 5; merged 1, 2, 3, 4, 5, 6, median (3 + 4) ÷ 2 = 3.5same medians, different result
- Class A: mean 15 > median 12dragged up by a few big values
- Class B: mean 20 is close to median 21no strong tail
- (a) 18 hours (b) 2.5 against 3.5, so no (c) Class A, tail upwards, report the median
Where science uses this
Practise this
Report a mistake
More in Statistics
Is your child on track?
Take the free placement test


