Population, sample, parameter and statistic
The population is the whole group we want to know about: all voters in a country, all bulbs made today. A sample is the smaller group we actually look at.
- A parameter is a number about the population. It is usually unknown. Examples: true proportion p, true mean μ.
- A statistic is a number worked out from the sample. Examples: sample proportion p̂, sample mean x̄.
Memory trick: Population ↔ Parameter, Sample ↔ Statistic (same first letters).
Why take a sample?
Checking everyone (a census) is often too slow, too costly or impossible (you cannot burn every match to test it). A good sample is much cheaper.
Good samples are random
In a simple random sample, every member has the same chance to be picked. Other methods: stratified (pick randomly inside groups like age bands), systematic (every 10th person), cluster (pick whole classes or villages). Bias appears when some people are more likely to be chosen, for example asking only your friends, or an online poll where only keen people answer.
Sampling variability and the sampling distribution
Two random samples from the same population almost never give the same statistic. This natural wobble is sampling variability. It is not a mistake; it is chance.
If we imagine taking a great many samples of the same size n and plotting every p̂, we get the sampling distribution. For fairly large samples it is:
- centred on the true value (p̂ is an unbiased estimate of p; x̄ of μ),
- bell-shaped (close to a normal distribution),
- with spread called the standard error: SE(p̂) = √(p(1−p)/n), SE(x̄) = σ/√n.
Because n sits under a square root, making the sample 4 times bigger makes the spread only half as big.
Checking a model by simulation
Suppose a company claims 40% of its customers are students, and your random sample of 50 has only 10 students (20%). Is the claim believable? Use a computer (or the 3D above) to take many fake samples of 50 from a population with p = 0.4. If 20% or less almost never happens, the data are not consistent with the claim. If it happens often, the claim still fits.
Estimating: point estimates and confidence intervals
A point estimate is one number: "p̂ = 0.42". It is our best single guess, but it will almost never be exactly right.
An interval estimate gives a range and a level of trust:
- Proportion: p̂ ± z* √(p̂(1−p̂)/n)
- Mean (σ known or n large): x̄ ± z* · σ/√n
The part after ± is the margin of error. Common values of z*: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%.
What does "95% confident" mean?
If we repeated the sampling many times and built an interval each time, about 95% of the intervals would contain the true value. It does not mean "there is a 95% chance p is in this one interval" in the everyday sense: p is fixed, the interval is what changes (see the green and red bands in step 4).
Making the interval narrower
- Take a bigger sample (n up → SE down).
- Accept a lower confidence level (99% → 95% gives a narrower band, but less trust).
Sample size for a wanted margin E (proportion, worst case p = 0.5): n ≈ (z*/(2E))². For E = 0.03 at 95%: n ≈ (1.96/0.06)² ≈ 1068.
Comparing groups and judging conclusions
Inference also lets us compare two groups, for example the share of students in two schools who walk to school.
- Look at the difference of the two statistics (e.g. 0.55 − 0.40 = 0.15).
- Compare it with the natural wobble. If the two confidence intervals do not overlap at all, the difference is clearly real. If they overlap a lot, the difference may be just chance.
- An effect size (difference divided by a typical spread) tells how big the difference is in practice.
Association is not causation
Ice-cream sales and drowning both rise in summer. They are associated, but ice-cream does not cause drowning; hot weather drives both (a confounding variable). Only a randomised experiment, where chance decides who gets the treatment, can show cause.
Checklist for judging a claim
- Was the sample random? Who was left out?
- How big was n? What is the margin of error?
- Survey, experiment or observational study?
- Is the conclusion about the right population?
- Is the difference bigger than chance alone would give?
Try it at home
Put 40 red and 60 other-coloured items (buttons, beads, paper slips) into a bag. Shake. Without looking, take 20, write down the share of red, and put them back. Repeat 15 times and make a dot plot. Where is the middle? Now repeat with samples of 5. Which dot plot is wider? Then try the sliders in the 3D above and compare.
Key formulas and definitions
- Sample proportion: p̂ = (number with the feature) ÷ n
- Standard error of a proportion: SE = √(p(1−p)/n)
- Standard error of a mean: SE = σ/√n
- Confidence interval for p: p̂ ± z*·√(p̂(1−p̂)/n)
- Confidence interval for μ: x̄ ± z*·σ/√n
- z* = 1.645 (90%), 1.96 (95%), 2.576 (99%)
- Sample size for margin E (proportion): n ≈ (z*/(2E))²
Worked examples
1. In a random sample of 80 students, 28 cycle to school. Find the point estimate of the proportion who cycle.
p̂ = 28 ÷ 80 = 0.35. Our best single estimate is 35%.
2. The true proportion is p = 0.4. Find the standard error of p̂ for samples of n = 100 and n = 400.
n = 100: SE = √(0.4 × 0.6 / 100) = √0.0024 ≈ 0.049. n = 400: SE = √(0.24/400) = √0.0006 ≈ 0.0245. Four times the sample halves the SE.
3. A survey of 500 adults finds 210 use a fitness app. Build a 95% confidence interval for the true proportion.
p̂ = 210/500 = 0.42. SE = √(0.42 × 0.58 / 500) = √0.000487 ≈ 0.0221. Margin = 1.96 × 0.0221 ≈ 0.043. Interval: 0.42 ± 0.043 = (0.377, 0.463). We are 95% confident that between about 37.7% and 46.3% of adults use such an app.
4. Packets of rice have σ = 8 g. A sample of 64 packets has mean x̄ = 998 g. Find a 95% confidence interval for μ. Is the label "1000 g" believable?
SE = 8/√64 = 1 g. Margin = 1.96 × 1 = 1.96 g. Interval: 998 ± 1.96 = (996.04, 999.96) g. 1000 g lies just outside, so the data suggest the mean is a little below 1000 g.
5. How large a sample is needed to estimate a proportion within ±4% at 95% confidence?
Use the safe value p = 0.5. n ≈ (1.96 / (2 × 0.04))² = (24.5)² = 600.25. Round up: n = 601.
6. A claim says p = 0.5. In 200 simulated samples of size 40 from p = 0.5, a share of 0.30 or less appeared 3 times. Your real sample gave 0.30. Is the claim consistent with your data?
Such a low result happened in 3/200 = 1.5% of simulations. It is very rare if the claim is true, so the data are not consistent with p = 0.5. The true proportion is probably lower.
Common mistakes
- Mixing up parameter and statistic. p and μ belong to the population; p̂ and x̄ come from the sample.
- Saying a 95% interval has a 95% chance of containing p after it is built. The 95% describes the method over many samples.
- Thinking a bigger population needs a much bigger sample. The SE depends on n, not on the population size (if the population is large).
- Concluding cause from an observational study. Association alone does not prove that one thing causes the other.