You can rarely measure the population
Nobody surveys the entire population of a country, assays every molecule in a batch, or loads every historical transaction into memory before answering a question. Sampling is the deliberate substitution of a manageable subset for an unmanageable whole, and the entire apparatus of statistical inference exists to make that substitution defensible. The sample is not a miniature of the population by magic; it is a miniature because a known mechanism selected it, and knowing that mechanism is what licenses the leap from the subset to the whole.
The distinction that governs everything downstream is between probability and non-probability sampling. Under probability sampling every unit has a known, non-zero chance of selection, which makes it possible to compute a margin of error. Under convenience sampling, voluntary response panels, and snowball recruitment, that chance is unknown or zero for entire groups, so no formula can rescue the estimate. A sample of one thousand drawn by a lottery predicts an election within a couple of points; a sample of a hundred thousand recruited from an online panel can be off by ten and still be internally consistent. Size cannot repair a broken selection mechanism.
Four designs and when each earns its cost
Simple random sampling gives every subset of the target size exactly the same probability of being chosen. It is the gold standard for unbiasedness and the simplest to analyse, but it requires a complete sampling frame â a list of every unit â which is often the expensive part of a study. Stratified sampling divides the population into homogeneous groups known in advance, samples independently inside each, and pools the results with weights. When strata differ substantially in the outcome, stratification cuts variance for the same budget because the design guarantees representation instead of leaving it to chance.
Cluster sampling takes the opposite route: it selects groups at random and then measures everyone inside the chosen groups. It is far cheaper when the population is geographically spread out, since travel or contact costs scale with clusters rather than units, but observations within a cluster resemble each other, so the effective sample size is smaller than the headcount suggests. Systematic sampling picks a random start and then every k-th unit thereafter. It is trivial to implement on an assembly line or a database table, and it spreads the sample evenly across the ordering, but a hidden period in the list that interacts with the sampling interval can bias the result badly.
| Design | Selection rule | Analysed with | Strength | Weakness |
|---|---|---|---|---|
| Simple random | Every subset equally likely | Direct formulas | Unbiased, easy inference | Needs a full sampling frame |
| Stratified | Random within each stratum | Weighted stratum means | Lower variance, guaranteed coverage | Requires strata known beforehand |
| Cluster | Random clusters, census inside | Design effects and cluster counts | Cheapest for spread populations | Intra-cluster correlation inflates variance |
| Systematic | Random start, fixed interval | Treated as random if list is random | Even coverage, trivial to run | Periodicity can bias it |
The biases no sample size can fix
Selection bias occurs when the mechanism systematically excludes part of the target population, so the estimate converges to the wrong value no matter how many observations you collect. Non-response bias is the same problem wearing a different hat: units were selected correctly, but the ones who answered differ from the ones who declined. Survivorship bias appears whenever the sample is conditioned on an outcome â studying only companies that survived, or only players who still log in â which removes exactly the failures you needed to see.
Undercoverage happens when some units have zero probability of selection, as with telephone surveys that miss households without landlines or product analytics that never fire for users on a particular device. Self-selection and convenience sampling are undercoverage by design. The remedy is never a larger n. It is a redesign: broaden the frame, follow up with non-respondents, weight by known population margins, or switch to a probability design and accept the cost.
The sampling distribution of a statistic
Once you fix a design and repeat the whole study in your head, the statistic â a mean, a proportion, a regression slope â becomes a random variable with its own distribution. That is the sampling distribution, and it is the object every confidence interval and hypothesis test is built from. The mean of the sampling distribution is the statistic's expected value; if it equals the population parameter, the estimator is unbiased. Its spread is the standard error, which is a different quantity from the spread of the raw data.
The central limit theorem is what makes the sampling distribution tractable. For independent draws with finite variance, the standardised sample mean converges to a standard normal as the sample grows, regardless of the shape of the population distribution. The speed of that convergence depends on the population: symmetric distributions are close after a dozen observations, while heavily skewed ones may need fifty to a hundred. This is why the normal approximation is reliable for large samples even when the underlying variable â income, waiting time, claim sizes â is plainly not normal.
Standard error and the square root law
The standard error of the mean is the population standard deviation divided by the square root of the sample size. That square root is the single most important practical fact in sampling, because it sets the price of precision. Halving the margin of error requires quadrupling the sample; reducing it by a factor of ten requires a hundred times the data. When the population is not effectively infinite, a finite population correction factor shrinks the standard error further once the sample takes a serious bite out of the population.
Stratified designs get their gain by replacing one large variance with a weighted combination of smaller within-stratum variances. If the strata are genuinely homogeneous internally, the weighted estimator beats simple random sampling at equal cost, and the improvement can be large when the strata were defined by the very variable being measured. The trade-off is that the weights must match the population proportions, which means the stratum sizes have to be known.
Planning a study in Python
import numpy as np
def sampling_distribution(mu, sigma, n, repeats=20_000, seed=0):
"""Repeated sample means and their empirical standard error."""
rng = np.random.default_rng(seed)
means = rng.normal(mu, sigma, size=(repeats, n)).mean(axis=1)
return means.mean(), means.std(ddof=1)
def standard_error(sigma, n, population=None):
se = sigma / np.sqrt(n)
if population is not None and n > 1:
se *= np.sqrt((population - n) / (population - 1))
return se
def stratified_mean(groups, weights):
"""Weighted mean of stratum means."""
return sum(w * np.mean(g) for w, g in zip(weights, groups))
def sample_size_for_margin(sigma, z, margin):
return int(np.ceil((z * sigma / margin) ** 2))
emp_mean, emp_se = sampling_distribution(50.0, 12.0, 64)
print(f"empirical SE = {emp_se:.4f}, theory = {12.0 / np.sqrt(64):.4f}")
print("n needed for +/-1.5:", sample_size_for_margin(12.0, 1.96, 1.5))
low = np.random.default_rng(1).normal(40, 5, 400)
high = np.random.default_rng(2).normal(70, 5, 600)
print("pooled mean:", round(np.concatenate([low, high]).mean(), 3))
print("stratified :", round(stratified_mean([low, high], [0.4, 0.6]), 3))
The first line confirms the theoretical standard error against an empirical one built from twenty thousand replications, and the sample-size call shows the square-root law in action. The last pair of prints demonstrates that weighting stratum means by their population shares reproduces the pooled mean when the weights are correct.
A short simulation makes the central limit theorem concrete rather than quotable.
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng(7)
exponential = rng.exponential(scale=2.0, size=(20_000, 5))
skewed_sample_means = exponential.mean(axis=1)
normal_pop = rng.normal(loc=2.0, scale=2.0, size=(20_000, 5))
normal_sample_means = normal_pop.mean(axis=1)
print("skewed parent, n=5 skew of means:",
round(float(np.mean(((skewed_sample_means - skewed_sample_means.mean())
/ skewed_sample_means.std()) ** 3)), 3))
print("normal parent, n=5 skew of means:",
round(float(np.mean(((normal_sample_means - normal_sample_means.mean())
/ normal_sample_means.std()) ** 3)), 3))
print("skew of a single exponential draw: 2.0")
plt.hist(skewed_sample_means, bins=60, alpha=0.6, label="means of n=5")
plt.legend()
plt.show()
Even at a sample size of five, the distribution of means from a strongly right-skewed parent is visibly more symmetric than the parent itself, and the skewness statistic drops well below two. That is the central limit theorem doing its job early.
Sampling errors that survive big data
Common Mistakes
Treating a convenience sample as if it were random
Fix: State the selection mechanism; if units had no known chance of selection, no margin of error applies.
Ignoring non-response and reporting only respondent statistics
Fix: Track response rates by group and apply weighting or follow-up interviews to bound the bias.
Assuming a larger sample removes systematic bias
Fix: Bias does not shrink with n; redesign the frame or the recruitment instead.
Applying the simple random sample formula to a cluster design
Fix: Adjust for the design effect caused by intra-cluster correlation before quoting precision.
Expecting linear gains in precision
Fix: Standard error falls with the square root of n, so quadruple the sample to halve the error.
Skipping the finite population correction on a large fraction
Fix: Apply the correction once the sample exceeds about five percent of the population.
Sampling essentials
Where to go next
- Population vs Sample sets up parameters, statistics, and the sampling frame.
- Sampling Techniques details allocation strategies within stratified designs.
- Sampling Bias and Errors catalogues famous polling failures and their causes.
- Central Limit Theorem proves why the sampling distribution of the mean becomes normal.