Lemma
← All topics
Statistics

Statistical sampling

Learning about everyone by asking a few.

Introduction

Statistics starts with data, and data usually comes from a sample rather than the whole population. How you choose the sample decides whether your conclusions can be trusted. This topic covers the vocabulary (population, sample, census, sampling frame, sampling unit), the main sampling methods with their advantages and disadvantages, and how to choose between them.

Why it matters

In 1936 a US magazine polled 2.4 million people and predicted the wrong president, because its sample came from telephone directories and car registrations, which only richer voters had. A much smaller but well-chosen sample predicted correctly. How you sample matters more than how many you ask.

Intuitive explanation

IntuitionA good sample is a mini-population

Imagine tasting soup. If it is well stirred, one spoonful tells you about the whole pot. Random sampling is the stirring: it makes every part of the population equally likely to appear, so the sample looks like a small copy of the population. Bias is tasting only from the top, where the salt has not mixed in.

Formal definitions

DefinitionKey vocabulary
  • Population: the whole set of items of interest.
  • Census: observes or measures every member of the population.
  • Sample: a subset of the population.
  • Sampling unit: an individual member that can be sampled.
  • Sampling frame: a list of sampling units, used to select the sample.
DefinitionRandom methods
  • Simple random sampling: every sample of size nn is equally likely; use a numbered frame and random numbers.
  • Systematic sampling: choose every kkth item from the frame, starting at a random point, where k=Nnk = \frac{N}{n}.
  • Stratified sampling: split the population into groups (strata) and take a simple random sample from each, in proportion to the group size.
DefinitionNon-random methods
  • Quota sampling: the interviewer fills quotas for each group, choosing whoever is available.
  • Opportunity (convenience) sampling: use whoever is available at the time.

Notation

  • NN is the population size and nn the sample size.
  • Stratum sample size: stratum sizeN×n\dfrac{\text{stratum size}}{N} \times n.

Comparison table

MethodNeeds a frame?Main advantageMain disadvantage
Simple randomYesFree of biasFrame may be hard to obtain
SystematicYesSimple, quick for large populationsBias if the list has a pattern
StratifiedYesReflects population structureStrata must be clearly defined
QuotaNoQuick, no frame neededNot random; interviewer bias
OpportunityNoEasy and cheapUnlikely to be representative

Key ideas

PropositionCensus or sample?

A census gives completely accurate information, but is expensive, slow, and impossible if testing destroys the item (such as testing how long batteries last). A sample is cheaper and quicker, but there is natural variation between samples, and it may be biased.

PropositionLarger samples

Larger random samples give better estimates, because sample-to-sample variation shrinks. A larger biased sample does not fix bias.

PropositionSelection probabilities

In a simple random sample of nn from NN, every member is chosen with probability nN\dfrac nN, and every possible sample of size nn is equally likely. Systematic and proportional stratified samples also give every member probability nN\dfrac nN, but they allow far fewer possible samples.

PropositionEstimating from a sample
  • Capture–recapture: mark MM animals; later catch CC, of which mm are marked. Then MN≈mC\dfrac{M}{N} \approx \dfrac mC, so N≈MCmN \approx \dfrac{MC}{m}.
  • Re-weighting: if a group makes up a share WW of the population, its sample result should count with weight WW, whatever its share of the sample.

Why randomness removes bias

IntuitionNo one chooses who is in the sample

With random selection, no personal choice decides who is included, so no group is systematically favoured. Every unit has the same chance, so on average the sample's composition matches the population's. Bias can still come from elsewhere: a poor frame, non-response, or leading questions.

ProofEvery subset is equally likely, and every unit has chance nN\frac nN

Draw units one at a time without replacement, each time uniformly from those not yet chosen. A particular ordered sequence of nn distinct units has probability 1N⋅1N−1⋯1N−n+1\frac1N\cdot\frac1{N - 1}\cdots\frac1{N - n + 1}. Each unordered sample arises from n!n! orders, so every sample of size nn has probability

n! (N−n)!N!=1(Nn).\frac{n!\,(N - n)!}{N!} = \frac1{\binom Nn}.

That is exactly the definition of a simple random sample. A given unit lies in (N−1n−1)\binom{N - 1}{n - 1} of the samples, so it is chosen with probability (N−1n−1)/(Nn)=nN\binom{N - 1}{n - 1}\big/\binom Nn = \frac nN.

∎
ProofSystematic and proportional stratified samples are fair to units, not to subsets

With interval k=Nnk = \frac Nn and a uniform random start, each unit belongs to exactly one of the kk possible samples, so it is chosen with probability 1k=nN\frac1k = \frac nN. In a proportional stratified sample a unit in stratum hh is chosen with probability nhNh=nN\frac{n_h}{N_h} = \frac nN (Q49). So all three random methods give every unit the same chance. Only simple random sampling gives every subset of size nn the same chance: systematic sampling allows just kk subsets, and stratified sampling allows only the balanced ones (Q59).

∎
ProofThe sample mean is unbiased under any equal-probability design

Let IiI_i indicate that unit ii is in the sample, so yˉ=1n∑i=1NIiyi\bar y = \frac1n\sum_{i = 1}^N I_iy_i. If E(Ii)=nNE(I_i) = \frac nN for every ii, linearity gives

E(yˉ)=1n∑i=1NnN yi=μ.E(\bar y) = \frac1n\sum_{i = 1}^N\frac nN\,y_i = \mu.

Independence is never needed. The designs differ not in their mean but in their variance, which depends on the joint probabilities P(Ii=Ij=1)P(I_i = I_j = 1): see the next section.

∎

Methods

MethodSimple random sample

Number the sampling frame 11 to NN, generate random numbers (ignoring repeats and numbers out of range) until you have nn different units.

MethodSystematic sample

Compute k=N÷nk = N \div n, choose a random start between 11 and kk, then take every kkth unit.

MethodStratified sample

For each stratum, sample size =stratum sizeN×n= \dfrac{\text{stratum size}}{N}\times n, rounded sensibly so the total is nn. Then take a simple random sample within each stratum.

Examples

ExampleStratified numbers

A school has 300 Year 12 and 200 Year 13 students. A stratified sample of 50: 300500×50=30\frac{300}{500}\times50 = 30 from Year 12 and 2020 from Year 13.

More examples are in the Worked examples tab.

Common mistakes

Common mistakeCalling quota sampling random

Quota sampling uses groups like stratified sampling, but the choice within each group is not random.

Common mistakeVague advantages

"It is quicker" earns nothing on its own. Say why in context: "no sampling frame is needed, so the researcher can start straight away in the town centre".

Common mistakeForgetting the random start

Systematic sampling needs a random starting point; otherwise it is not random.

Applications

  • Opinion polls use quota and stratified methods by age, region and voting history.
  • Quality control: a factory tests every 100th item from a production line (systematic).
  • Ecology: quadrats placed at random positions estimate plant populations.

Connections

Summary

  • Population, census, sample, sampling unit, sampling frame.
  • Random: simple random, systematic (k=N/nk = N/n, random start), stratified (proportional).
  • Non-random: quota, opportunity.
  • Give advantages and disadvantages in context.

Worked examples

Try each one yourself first, then open the solution.

Example 1A stratified sample

A company has 120 office staff, 240 factory staff and 40 managers. Describe how to take a stratified sample of 50 employees.

Show the solution
  1. 1Total

    N=400N = 400.

  2. 2Proportional sizes

    Office 120400×50=15\frac{120}{400}\times50 = 15, factory 240400×50=30\frac{240}{400}\times 50 = 30, managers 40400×50=5\frac{40}{400}\times50 = 5.

  3. 3Select within strata

    Number each group separately and use random numbers to choose 15, 30 and 5 people respectively.

Answer

15 office, 30 factory, 5 managers, chosen at random within each group

Example 2A systematic sample

Describe how to take a systematic sample of 20 from a list of 600 customers.

Show the solution
  1. 1Interval

    k=600÷20=30k = 600 \div 20 = 30.

  2. 2Random start

    Choose a random number between 1 and 30, say 17.

  3. 3Select

    Take customers 17, 47, 77, ..., 587.

Answer

Every 30th customer from a random start in 1–30

Example 3Quota versus stratified

A researcher wants the views of 60 shoppers: 30 men and 30 women. Explain the difference between using quota sampling and stratified sampling here.

Show the solution
  1. 1Quota

    The researcher stands in the shopping centre and interviews any men and women until each quota of 30 is filled. No frame is needed, but the choice of who to ask is not random.

  2. 2Stratified

    The researcher needs a list of all shoppers split by gender, and selects 30 of each at random. This is random but needs a frame, which is unlikely to exist for shoppers.

Answer

Both use groups; only stratified sampling selects randomly within them

Example 4When a census is impossible

A manufacturer wants to know the mean lifetime of its light bulbs. Explain why a census is not appropriate.

Show the solution
  1. 1Testing destroys

    Measuring a bulb's lifetime means running it until it fails.

  2. 2Conclude

    A census would destroy every bulb, leaving none to sell. A sample must be used.

Answer

Testing is destructive

Beyond the specification

University-level ideas and the deeper mathematics behind this topic. Not needed for exams, but this is where the subject really opens up.

Design-based inference: inclusion probabilities and variance (university)

In survey sampling the population values y1,…,yNy_1, \ldots, y_N are fixed numbers. All randomness comes from the design: which units we choose. This is different from the usual statistical model, where the data themselves are random.

DefinitionInclusion probabilities

For a sampling design, πi=P(i∈S)\pi_i = P(i \in S) is the first-order inclusion probability and πij=P(i,j∈S)\pi_{ij} = P(i, j \in S) the second-order one. For simple random sampling, πi=nN\pi_i = \frac nN and πij=n(n−1)N(N−1)\pi_{ij} = \frac{n(n - 1)}{N(N - 1)}.

TheoremHorvitz–Thompson estimator

If every πi>0\pi_i > 0, then T^=∑i∈Syiπi\hat T = \sum_{i \in S}\dfrac{y_i}{\pi_i} is an unbiased estimator of the population total T=∑i=1NyiT = \sum_{i = 1}^Ny_i, with

Var⁡(T^)=∑i=1N∑j=1N(πij−πiπj)yiπiyjπj,πii=πi.\operatorname{Var}(\hat T) = \sum_{i = 1}^N\sum_{j = 1}^N(\pi_{ij} - \pi_i\pi_j)\frac{y_i}{\pi_i}\frac{y_j}{\pi_j}, \qquad \pi_{ii} = \pi_i.
Proof

Write T^=∑iIiyiπi\hat T = \sum_i I_i\frac{y_i}{\pi_i}. Then E(T^)=∑iπiyiπi=TE(\hat T) = \sum_i \pi_i\frac{y_i}{\pi_i} = T. For the variance, Cov⁡(Ii,Ij)=E(IiIj)−πiπj=πij−πiπj\operatorname{Cov}(I_i, I_j) = E(I_iI_j) - \pi_i\pi_j = \pi_{ij} - \pi_i\pi_j, and Var⁡(∑iaiIi)=∑i,jaiajCov⁡(Ii,Ij)\operatorname{Var}\left(\sum_i a_iI_i\right) = \sum_{i, j}a_ia_j\operatorname{Cov}(I_i, I_j). ■\blacksquare

∎

Each sampled unit "stands for" 1πi\frac1{\pi_i} units of the population; that is the idea behind the re-weighting in Q43. Units with πi=0\pi_i = 0 (like people missing from the frame, Q17) can never be represented, and no estimator can recover them: this is why coverage matters more than cleverness.

ExampleSimple random sampling

Putting πi=nN\pi_i = \frac nN and the πij\pi_{ij} above into the Horvitz–Thompson variance, and dividing by N2N^2 to pass from totals to means, gives

Var⁡(yˉ)=S2n(1−nN),S2=1N−1∑i=1N(yi−μ)2,\operatorname{Var}(\bar y) = \frac{S^2}{n}\left(1 - \frac nN\right),\qquad S^2 = \frac{1}{N - 1}\sum_{i = 1}^N(y_i - \mu)^2,

which is the formula of Q52, written with the divisor N−1N - 1. The factor 1−nN1 - \frac nN is the finite population correction. Remarkably, when NN is large the precision depends on nn alone, not on nN\frac nN: a poll of 10001000 people is about as accurate for a country of 6060 million as for a city of 11 million.

An unbiased estimate of this variance is s2n(1−nN)\frac{s^2}{n}\left(1 - \frac nN\right), with s2s^2 the sample variance (divisor n−1n - 1). This is why textbooks use n−1n - 1: E(s2)=S2E(s^2) = S^2 under simple random sampling.

Why stratification works, and optimal allocation (university)

Split the population into strata h=1,…,Hh = 1, \ldots, H with sizes NhN_h, weights Wh=NhNW_h = \frac{N_h}{N}, means μh\mu_h and within-stratum variances Sh2S_h^2. Take independent simple random samples of size nhn_h in each stratum and use yˉst=∑hWhyˉh\bar y_{st} = \sum_hW_h\bar y_h.

TheoremVariance of the stratified estimator
E(yˉst)=μ,Var⁡(yˉst)=∑h=1HWh2 Sh2nh(1−nhNh).E(\bar y_{st}) = \mu, \qquad \operatorname{Var}(\bar y_{st}) = \sum_{h = 1}^HW_h^2\,\frac{S_h^2}{n_h}\left(1 - \frac{n_h}{N_h}\right).

The samples in different strata are independent, so the variances simply add. The crucial point is that only within-stratum variances appear.

PropositionAnalysis of variance

The population variance splits into a within part and a between part:

∑i(yi−μ)2=∑h∑i∈h(yi−μh)2+∑hNh(μh−μ)2.\sum_{i}(y_i - \mu)^2 = \sum_h\sum_{i \in h}(y_i - \mu_h)^2 + \sum_hN_h(\mu_h - \mu)^2.
Proof

Write yi−μ=(yi−μh)+(μh−μ)y_i - \mu = (y_i - \mu_h) + (\mu_h - \mu) and square. The cross term is 2∑h(μh−μ)∑i∈h(yi−μh)=02\sum_h(\mu_h - \mu)\sum_{i \in h}(y_i - \mu_h) = 0, because deviations from a stratum's own mean add to zero. ■\blacksquare

∎

Ignoring finite population corrections, proportional allocation (nh=nWhn_h = nW_h) gives Var⁡(yˉst)=1n∑hWhSh2\operatorname{Var}(\bar y_{st}) = \frac1n\sum_hW_hS_h^2, while simple random sampling gives roughly 1n(∑hWhSh2+∑hWh(μh−μ)2)\frac1n\left(\sum_hW_hS_h^2 + \sum_hW_h(\mu_h - \mu)^2\right). So proportional stratification is never worse (to this approximation), and removes the entire between-strata term. Stratify on whatever variable best separates the means: that is what made the design of Q53 thirty times better.

TheoremNeyman allocation

For fixed total nn (and ignoring finite population corrections), Var⁡(yˉst)\operatorname{Var}(\bar y_{st}) is minimised by nh∝NhShn_h \propto N_hS_h, and the minimum is 1n(∑hWhSh)2\frac1n\left(\sum_hW_hS_h\right)^2.

The proof is a single use of the Cauchy–Schwarz inequality (Q54). If sampling in stratum hh costs chc_h per unit and the budget is fixed, the same argument gives nh∝NhShchn_h \propto \frac{N_hS_h}{\sqrt{c_h}}: sample more where the stratum is big, varied and cheap. Comparing with proportional allocation,

1n∑hWhSh2−1n(∑hWhSh)2=1n∑hWh(Sh−Sˉ)2≥0,Sˉ=∑hWhSh,\frac1n\sum_hW_hS_h^2 - \frac1n\Big(\sum_hW_hS_h\Big)^2 = \frac1n\sum_hW_h(S_h - \bar S)^2 \ge 0,\qquad \bar S = \sum_hW_hS_h,

so Neyman beats proportional allocation exactly by the spread of the stratum standard deviations.

IntuitionSystematic sampling as implicit stratification

A systematic sample with interval kk takes exactly one unit from each block of kk consecutive units: it is like a stratified sample with nn strata, except that the position within each block is the same for all blocks. On a list with a trend this is excellent (Q56). On a list with a cycle of period kk the "same position" coincidence is fatal (Q44). The variance of a systematic sample can be written using the correlation between units in the same sample; roughly speaking, it beats simple random sampling when units in the same sample tend to be unlike each other.

When samples mislead: non-response, big data and clever designs (university)

The variance formulas above assume the design is carried out as planned. In practice the biggest errors are biases, and these do not shrink as nn grows.

TheoremMeng's identity (the "big data paradox")

Let Ri=1R_i = 1 if unit ii ends up in the data (by any process, random or not), n=∑Rin = \sum R_i, and f=nNf = \frac nN. Then

yˉn−μ=ρR,y⋅1−ff⋅σy,\bar y_n - \mu = \rho_{R,y}\cdot\sqrt{\frac{1 - f}{f}}\cdot\sigma_y,

where ρR,y\rho_{R, y} is the population correlation between RR and yy and σy\sigma_y is the population standard deviation of yy.

Proof

Over the population, Cov⁡(R,y)=1N∑Riyi−fμ=f(yˉn−μ)\operatorname{Cov}(R, y) = \frac1N\sum R_iy_i - f\mu = f(\bar y_n - \mu). Since RR takes values 0,10, 1 with mean ff, σR=f(1−f)\sigma_R = \sqrt{f(1 - f)}. Hence yˉn−μ=ρR,yσRσyf=ρR,y1−ff σy\bar y_n - \mu = \frac{\rho_{R, y}\sigma_R\sigma_y}{f} = \rho_{R, y}\sqrt{\frac{1 - f}{f}}\,\sigma_y. ■\blacksquare

∎

The error is the product of data quality (ρ\rho), data quantity ((1−f)/f\sqrt{(1 - f)/f}) and problem difficulty (σ\sigma). Random sampling makes E(ρ)=0E(\rho) = 0 with ρ\rho of order 1N\frac1{\sqrt N}. A self-selected sample has ρ\rho of fixed size however large it is. With N=300N = 300 million, a self-selected "sample" of 33 million (f=1f = 1%) and a tiny correlation ρ=0.005\rho = 0.005 has the same error as a simple random sample of only about 400400 people. That is the Literary Digest story (Q58) in one formula.

DefinitionCapture–recapture as a sampling problem

If MM marked animals are present and a random sample of CC is caught, the number marked is hypergeometric, and N^=⌊MCm⌋\hat N = \left\lfloor\frac{MC}{m}\right\rfloor maximises the likelihood (Q55). The method needs the recapture to be a genuine random sample with respect to marking: trap-happy or trap-shy animals give ρ≠0\rho \ne 0 in Meng's sense, and the bias does not average out.

MethodRandomised response

Sensitive questions produce untruthful answers, a bias that no sample size fixes. In Warner's design (Q60) each respondent uses a private random device, so that P(Yes)=a p+bP(\text{Yes}) = a\,p + b for known constants aa and bb. The estimator p^=λ^−ba\hat p = \frac{\hat\lambda - b}{a} is unbiased, with variance inflated by the factor 1a2\frac1{a^2}. This is an early example of local differential privacy: the answer reveals only a bounded amount about any one person, yet the population proportion is still estimable. Census bureaus now add calibrated noise to published tables for the same reason.

IntuitionThe lesson of the whole topic

Precision comes from the size of a sample, but accuracy comes from how it was chosen. Random selection is what makes the sampling error measurable, by the formulas of the first section, and guarantees that it shrinks like 1n\frac1{\sqrt n}. Without it, the error has an unknown sign and size, and a bigger sample only makes you more confident in the wrong answer.

Why does this work?

Why does this work?Why does random sampling remove bias?

With random selection, every member of the population has the same chance of being chosen, so on average each group appears in the sample in the same proportion as in the population. Any difference between sample and population is then due to chance alone, and chance can be measured and controlled by taking larger samples. A non-random method can be wrong in a systematic direction that no amount of extra data will fix.

Beyond the syllabus

Beyond the syllabusWhy stratifying reduces variance

If a population splits into groups with different means, a simple random sample may by chance over-represent one group. Stratified sampling fixes the proportions, removing that source of variation. For a stratified sample with proportional allocation, the variance of the sample mean is 1n∑hWhσh2\frac1n\sum_h W_h\sigma_h^2 (within-strata variances only), never more than the simple random sample's σ2n\frac{\sigma^2}n, because σ2=∑Whσh2+∑Wh(μh−μ)2\sigma^2 = \sum W_h\sigma_h^2 + \sum W_h(\mu_h - \mu)^2.

Beyond the syllabusCapture–recapture

To estimate the number NN of fish in a lake, catch and tag MM, release them, then catch nn and count the tagged ones, mm. If the tagged fish mix randomly, mn≈MN\frac mn \approx \frac MN, so N≈MnmN \approx \frac{Mn}{m} (the Lincoln–Petersen estimator). The same idea estimates hidden populations in ecology and epidemiology.

Mathematical curiosities

Mathematical curiositySurvivorship bias

In the Second World War, analysts studied bullet holes on returning bombers to decide where to add armour. Abraham Wald pointed out that they should armour where returning planes had no holes: planes hit there did not come back. The sample of returning planes was biased.

Further exploration

Further explorationInvestigations
  • Use the large data set to compare a systematic sample of 20 days with a simple random sample of 20 days. Which gives a mean temperature closer to the full data?
  • Design a stratified sample for a survey of students across year groups and subjects.
Now practise60 questions from Very easy to Extreme →