Sampling Distributions and CLT Concept Card Template (Statistics, R and Python)
Sampling distributions concept card: population vs sample, standard error, Central Limit Theorem and when n is large enough, SE of a proportion and a difference in means, origin of the t distribution, seeded R and Python simulation with a Vega-Lite chart
Cómo usar: Use it when you meet inference for the first time or need to explain a standard error. Look at the simulated chart first, then the formulas, then work Examples A, B and C and rerun the simulation with your own n. The main pitfall is confusing the SD of the data with the SE of the mean, and thinking the CLT makes the data normal.
Vista previa
Sampling Distributions and the Central Limit Theorem: [Your course or study question]
A concept card for the idea that holds all of statistical inference together: a statistic computed from a sample (a mean, a proportion, a difference) would come out differently in another sample, and the pattern of those values across all possible samples is its sampling distribution. The card covers population versus sample, statistic versus parameter, the standard error, the Central Limit Theorem and when a sample is "large enough", the sampling distributions of a proportion and of a difference in means, and why the t distribution appears. It is for students meeting inference for the first time, thesis writers who need to explain a standard error in their methods chapter, and analysts who want an honest intuition for when normal-based methods work. It speeds up learning with a picture first (a simulated sampling distribution you can reproduce), formulas second, worked examples that fade from fully solved to unsolved, and self-test questions with a separate answer key. The worked examples use fictional data; replace them with your own. Source basis: standard sampling theory, the NIST/SEMATECH e-Handbook of Statistical Methods, and the GAISE College Report emphasis on simulation-based understanding.
Document control
| Field | Value |
|---|---|
| Course or project | [STAT 101 Introduction to Statistics] |
| Learner or analyst | [Your name] |
| Data set | Fictional: Brightwell Bakery queue waiting times (simulated), Lakemoor University student surveys |
| Software and versions | R 4.5.1 (base, stats); Python 3.14 with numpy 2.5.4 and scipy 1.18.1; seed 2026 |
| Date | YYYY-MM-DD |
| Version | [0.1] |
The idea in one paragraph
You almost never see a whole population; you see one sample and compute a statistic from it, such as the sample mean , to estimate a parameter, such as the population mean . If you drew a different sample you would get a different . The sampling distribution is the distribution of the statistic over all possible samples of the same size from the same population. Its centre tells you whether the statistic is aimed at the right target (for the mean, it is: the average of all sample means equals ). Its spread, called the standard error SE, tells you how far a typical sample's statistic lands from the target; for a mean it equals , so quadrupling the sample size halves the error. The Central Limit Theorem (CLT) adds that, for a large enough sample size n, the sampling distribution of the mean is approximately normal even when the data themselves are not. Confidence intervals and hypothesis tests are nothing more than statements about where your one statistic sits within this distribution.
Intuition
Analogy. Imagine a darts player throwing at a board. Each throw is one sample statistic, and the bullseye is the parameter. You see only one dart, but you know the player's style: where the darts land on average (bias) and how widely they scatter (standard error). A good estimator is a player whose darts centre on the bullseye; a bigger sample is a steadier hand, so the darts cluster more tightly. The CLT says that, with enough throws averaged together, the scatter pattern takes the same bell shape, whatever the player's quirks (as long as the population has a finite variance).
Three levels to keep apart.
The three sample means in the diagram are illustrative. The real simulation below draws 10,000 samples.
The simulated picture. Brightwell Bakery (fictional) models queue waiting times as exponential with a mean of 4 minutes, a strongly right-skewed population (SD also 4). We drew 10,000 samples of size n = 5 and 10,000 of size n = 30, computed each sample's mean, and counted the means in half-minute bins. The bin counts below are the real counts from the seeded Python simulation (seed 2026); 8 of the 10,000 means for n = 5 were above 12 minutes and are not shown.
What the chart shows:
- Both histograms centre near 4, the population mean. The sample mean is unbiased whatever the sample size.
- The n = 30 histogram is much narrower. Its SD is about 0.72 minutes against about 1.79 for n = 5: a factor close to , as predicts.
- The n = 5 histogram is still skewed to the right (skewness about 0.9), echoing the skewed population. The n = 30 histogram is close to symmetric (skewness about 0.37). This is the CLT at work, and also a warning: for strongly skewed data, n = 5 is not "large enough".
Formal definitions
Structure aligned with standard sampling theory as presented in the NIST/SEMATECH e-Handbook and the GAISE College Report recommendation to use simulation to illustrate abstract ideas such as sampling variability; wording and examples are original.
Population, sample, parameter, statistic
A population is the whole set of units you want to describe (all customers' waiting times at the bakery this year). A sample is the subset you actually observe. A parameter is a fixed number describing the population, usually unknown (, , ). A statistic is a number computed from the sample (, , ), and it varies from sample to sample. Greek letters for parameters, Latin letters or hats for statistics is the usual convention.
Sampling distribution of the mean
For a simple random sample of size n from a population with mean and SD :
This follows from the variance rules in academic/stats-probability-basics: is the sum of n independent values divided by n, so its variance is . The SD of a sampling distribution is called the standard error. Because is usually unknown, we estimate it with the sample SD s:
If the sample is drawn without replacement from a small population of size N, multiply by the finite population correction ; it matters only when the sample is more than about 5% to 10% of the population.
The Central Limit Theorem
In words: when you average many independent values from almost any population with a finite variance, the average is approximately normally distributed, and the approximation improves as n grows.
When is n "large enough"? There is no universal number. The common rule "n of 30 or more" is a rough guide for moderately skewed data, not a law.
| Population shape | Sample size n where the normal approximation for is usually adequate |
|---|---|
| Normal | Any n (the sampling distribution is exactly normal) |
| Roughly symmetric, no outliers | About 10 to 15 |
| Moderately skewed | About 30 |
| Strongly skewed (exponential, incomes) | 30 to 50 or more; check by simulation (the simulation here still shows skewness 0.37 at n = 30) |
| Heavy tails or extreme outliers | May need hundreds, or use a robust or resampling method (academic/stats-resampling-methods) |
| Infinite variance (for example Cauchy) | Never: the CLT does not apply |
Sampling distribution of a proportion
A proportion is a mean of 0/1 values, so the same logic applies. If each unit is a "yes" with probability p:
The normal approximation is reasonable when the expected numbers of successes and failures are both at least 10: and . For and , ; the simulation below gives 0.0650 (R) and 0.0640 (Python).
Sampling distribution of the difference in means
For two independent samples, the variances add (never subtract):
With sample SDs in place of the s, this is the standard error used in the Welch t-test (see academic/stats-t-tests).
Where the t distribution comes from
If the data are normal and you standardise with the true , the result is exactly standard normal. But in practice you use s, which is itself random: in small samples it is often too small, which makes the standardised value too large. William Gosset, writing as "Student" (1908), worked out the exact distribution of
for normal data. The t distribution has heavier tails than the normal, to account for the extra uncertainty in s, and it approaches the normal as the degrees of freedom df grow. The simulation shows the practical consequence: with n = 5 from a normal population, intervals built as captured the true mean only 88.0% (R) and 88.4% (Python) of the time, while intervals using the t critical value 2.776 (df = 4) captured it 95.0% and 95.3% of the time, matching the promised 95%.
Notation table
| Symbol | Meaning | Level |
|---|---|---|
| , | Population mean and SD | Parameter (fixed, usually unknown) |
| Population proportion | Parameter | |
| , , | Sample mean, sample SD, sample proportion | Statistic (varies between samples) |
| The sample mean viewed as a random variable, before the sample is drawn | Random variable | |
| n | Sample size | Design |
| Standard error: SD of the sampling distribution | Sampling distribution | |
| Estimated standard error | Statistic | |
| df | Degrees of freedom, here | t distribution |
Worked example A (fully solved): sleep hours at Lakemoor University
Question. Lakemoor University (fictional) students sleep on average hours a night with SD hours. A survey samples 36 students at random. What is the probability that the sample mean is below 6.7 hours?
Step 1: identify the statistic. The question is about , the mean of 36 students, not one student.
Step 2: describe its sampling distribution. Centre . Standard error hours. Shape: sleep hours are roughly symmetric and n = 36, so the CLT makes approximately normal.
Step 3: standardise.
Step 4: look up the probability. (R pnorm(-1.5), Python norm.cdf(-1.5)).
Step 5: interpret. Only about 7% of random samples of 36 students would have a mean below 6.7 hours. Compare this with one student: . A single student sleeping less than 6.7 hours is common; a whole sample averaging that little is unusual. Averages vary less than individuals.
Worked example B (half solved): weekly library users
Question. Forty percent of Lakemoor University students use the library at least weekly (). A random sample of 100 students is surveyed. What is the probability that the sample proportion exceeds 0.48?
Step 1: identify the statistic. [ ]
Step 2: check the conditions. and , both at least 10, so the normal approximation is reasonable.
Step 3: standard error.
Step 4: standardise and look up. , and .
Step 5: interpret. About [ ] of samples of 100 would show more than 48% weekly users, so a survey result of 49% would be [ ].
Exercise C (unsolved): two campuses
Lakemoor University (fictional) has two campuses. On the North campus, scores on a common statistics exam have mean 70 and SD 10; on the South campus, mean 66 and SD 8. A random sample of 25 North students and an independent random sample of 16 South students are taken.
- What are the centre and the standard error of the sampling distribution of ?
- What is the probability that the South sample mean is higher than the North sample mean? Use the normal approximation.
- Why do the two variances add, even though we are subtracting the means?
Simulation you can run
The scripts draw 10,000 samples from the skewed waiting-time population for n = 5 and n = 30, compare the SD of the simulated means with , measure the remaining skewness, check the SE of a proportion, and compare the coverage of z-based and t-based intervals when is estimated. The Python script also prints the bin counts used for the chart above.
R (base R only)
# Brightwell Bakery (fictional): queue waiting times, exponential with mean 4 minutes (SD 4)
set.seed(2026)
reps <- 10000
for (n in c(5, 30)) {
means <- replicate(reps, mean(rexp(n, rate = 1 / 4)))
skew <- mean((means - mean(means))^3) / sd(means)^3
cat(sprintf("n = %2d: mean of means = %.3f, SD of means = %.3f, theory SE = %.3f, skewness = %.2f\n",
n, mean(means), sd(means), 4 / sqrt(n), skew))
}
# Sampling distribution of a proportion: p = 0.30, n = 50
phat <- rbinom(reps, 50, 0.30) / 50
cat(sprintf("p-hat: mean = %.3f, SD = %.4f, theory SE = %.4f\n", mean(phat), sd(phat), sqrt(0.3 * 0.7 / 50)))
# Why t: coverage of mean +/- 1.96 * s / sqrt(n) vs t interval, normal population, n = 5
cover_z <- cover_t <- logical(reps)
for (i in 1:reps) {
x <- rnorm(5, 50, 10); se <- sd(x) / sqrt(5)
cover_z[i] <- abs(mean(x) - 50) <= qnorm(0.975) * se
cover_t[i] <- abs(mean(x) - 50) <= qt(0.975, 4) * se
}
cat(sprintf("n = 5 coverage: z with s = %.3f, t(4) = %.3f\n", mean(cover_z), mean(cover_t)))
# Worked examples
cat(sprintf("A: pnorm(-1.5) = %.4f\n", pnorm(-1.5)))
cat(sprintf("B: z = %.3f, P = %.4f\n", (0.48 - 0.40) / sqrt(0.4 * 0.6 / 100), pnorm((0.48 - 0.40) / sqrt(0.4 * 0.6 / 100), lower.tail = FALSE)))
se_c <- sqrt(10^2 / 25 + 8^2 / 16)
cat(sprintf("C: SE = %.3f, z = %.3f, P = %.4f\n", se_c, -4 / se_c, pnorm(-4 / se_c)))
n = 5: mean of means = 4.004, SD of means = 1.800, theory SE = 1.789, skewness = 0.84
n = 30: mean of means = 3.986, SD of means = 0.730, theory SE = 0.730, skewness = 0.36
p-hat: mean = 0.299, SD = 0.0650, theory SE = 0.0648
n = 5 coverage: z with s = 0.880, t(4) = 0.950
A: pnorm(-1.5) = 0.0668
B: z = 1.633, P = 0.0512
C: SE = 2.828, z = -1.414, P = 0.0786
Python (numpy, scipy)
import json
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
reps = 10_000
bins = np.arange(0, 12.5, 0.5)
rows = []
for n in (5, 30):
means = rng.exponential(scale=4, size=(reps, n)).mean(axis=1)
print(f"n = {n:2d}: mean of means = {means.mean():.3f}, SD of means = {means.std(ddof=1):.3f}, "
f"theory SE = {4/np.sqrt(n):.3f}, skewness = {stats.skew(means):.2f}")
counts, _ = np.histogram(means, bins=bins)
rows += [{"n": f"n = {n}", "bin_start": float(b), "count": int(c)}
for b, c in zip(bins[:-1], counts) if c > 0]
phat = rng.binomial(50, 0.30, reps) / 50
print(f"p-hat: mean = {phat.mean():.3f}, SD = {phat.std(ddof=1):.4f}, theory SE = {np.sqrt(0.3*0.7/50):.4f}")
x = rng.normal(50, 10, size=(reps, 5))
se = x.std(axis=1, ddof=1) / np.sqrt(5)
err = np.abs(x.mean(axis=1) - 50)
print(f"n = 5 coverage: z with s = {(err <= 1.96*se).mean():.3f}, t(4) = {(err <= stats.t.ppf(0.975, 4)*se).mean():.3f}")
print(json.dumps(rows)) # bin counts for the Vega-Lite chart
n = 5: mean of means = 3.992, SD of means = 1.790, theory SE = 1.789, skewness = 0.90
n = 30: mean of means = 3.987, SD of means = 0.722, theory SE = 0.730, skewness = 0.37
p-hat: mean = 0.300, SD = 0.0640, theory SE = 0.0648
n = 5 coverage: z with s = 0.884, t(4) = 0.953
[{"n": "n = 5", "bin_start": 0.0, "count": 7}, {"n": "n = 5", "bin_start": 0.5, "count": 88}, ... (trimmed; full list in the chart)]
What the output teaches.
- The mean of the simulated means is within 0.02 of the population mean of 4 in every run: the sample mean is unbiased.
- The SD of the simulated means matches (1.789 for n = 5, 0.730 for n = 30) to within simulation noise. That SD is the standard error.
- Skewness falls from about 0.84 to 0.90 at n = 5 to about 0.36 to 0.37 at n = 30. The CLT is working, but the sampling distribution is not yet perfectly normal for this strongly skewed population. For an exponential population the exact skewness of the mean is : 0.89 for n = 5 and 0.37 for n = 30, matching the simulation.
- With n = 5, using 1.96 with an estimated SD gives about 88% coverage instead of 95%. Using the t critical value restores 95%. This is the practical reason the t distribution exists.
- The R script computes skewness with a simple moment formula (third central moment divided by the cube of
sd()), while scipy'sstats.skewuses the biased moment estimator throughout. With 10,000 simulated means the two formulas differ negligibly; the differences between the languages come mainly from different random draws.
Misconceptions
| Wrong statement | Correct statement |
|---|---|
| "The CLT says that with a large sample the data become normal." | The CLT is about the sampling distribution of the mean (or sum). A large sample of skewed waiting times is still skewed; a histogram of the data just shows the skew more clearly. |
| "SE and SD are the same thing." | The SD describes how individual values vary (about 4 minutes here). The SE describes how sample means vary (0.73 minutes for n = 30). SE = SD / . |
| "A larger sample has a smaller SD." | The sample SD estimates , which does not shrink with n. The SE shrinks with n. |
| "n of 30 or more is always large enough." | It depends on the population's skew and tails. The simulation still shows visible skew at n = 30 for an exponential population. |
| "Doubling the sample size halves the SE." | The SE falls with : halving it needs four times the sample size. |
| "The sampling distribution is something I observe." | You observe one sample. The sampling distribution is a theoretical (or simulated) distribution over all possible samples. |
| "Var of a difference = difference of variances." | For independent samples, : the variances add. |
| "The t distribution is only needed because the data are not normal." | The t is needed because is estimated by s, even when the data are exactly normal. |
Connections to other concepts
| This card | Leads to | Why it matters | My link |
|---|---|---|---|
| Standard error | academic/stats-confidence-intervals | A 95% CI is estimate ± critical value × SE. | [ ] |
| Sampling distribution under H0 | academic/stats-hypothesis-testing | A p-value is the tail area of the sampling distribution assuming H0 is true. | [ ] |
| t distribution origin | academic/stats-t-tests | Every t-test divides an estimate by its estimated SE and compares with . | [ ] |
| SE falls with | academic/stats-power-sample-size | Sample size planning is choosing n to make the SE small enough. | [ ] |
| Simulated sampling distributions | academic/stats-resampling-methods | The bootstrap simulates a sampling distribution by resampling your own data. | [ ] |
| Random sampling assumption | academic/stats-sampling-plan | The formulas assume random sampling; biased sampling breaks them, whatever n is. | [ ] |
| Variance rules | academic/stats-probability-basics | follows from adding independent variances. | [ ] |
Self-test questions
- In one sentence each, distinguish a parameter from a statistic, and the SD from the SE.
- A population has SD 12. What is the SE of the mean for n = 16, n = 64 and n = 144? What pattern do you see?
- A student says: "My sample of 200 incomes is right-skewed, so the CLT failed." What is wrong with this reasoning?
- For a population proportion p = 0.05, is a sample of n = 100 large enough to use the normal approximation for ? Show the check.
- Why does a 95% interval built with 1.96 and the sample SD capture the true mean less than 95% of the time when n = 5? Quote the simulation result.
- Using only mental arithmetic, rank these from smallest to largest SE: (a) mean of n = 25 from a population with SD 10; (b) mean of n = 100 from a population with SD 30; (c) mean of n = 400 from a population with SD 40.
My notes and next steps
| Topic | Confidence 1-5 | What still confuses me | Next action and date |
|---|---|---|---|
| Example: SE vs SD | 3 | Which one goes in the z formula | Redo Example A and explain it to a friend, YYYY-MM-DD |
| Parameter vs statistic | [ ] | [ ] | [ ] |
| CLT and "large enough" | [ ] | [ ] | [ ] |
| SE of a proportion and a difference | [ ] | [ ] | [ ] |
| Why the t distribution | [ ] | [ ] | [ ] |
Simulation experiments I ran and what I learned: [n = 100 gave SD of means ..., which matches ...].
Mistakes to copy into my error log (academic/stats-error-log): [Mistake, why it happened, the fix].
Sources and further reading
Based on standard sampling theory written in original wording, with the GAISE College Report's emphasis on simulation and conceptual understanding and the learning design from Dunlosky et al. (2013).
- Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25.
- Laplace, P.-S. (1812). Théorie analytique des probabilités. (Early form of the Central Limit Theorem.)
- NIST/SEMATECH e-Handbook of Statistical Methods, chapter 1 Exploratory Data Analysis and chapter 7 Product and Process Comparisons, https://www.itl.nist.gov/div898/handbook/ (accessed 2026-10-25). Public domain.
- GAISE College Report ASA Revision Committee (2016). Guidelines for Assessment and Instruction in Statistics Education College Report 2016. American Statistical Association.
- Dunlosky, J., Rawson, K. A., Marsh, E. J., Nathan, M. J., and Willingham, D. T. (2013). Improving students' learning with effective learning techniques. Psychological Science in the Public Interest, 14(1), 4–58.
- Weinstein, Y., and Sumeracki, M. (2018). Understanding How We Learn: A Visual Guide (illustrated by O. Caviglioli). Routledge.
- Further reading (named only): Diez, Çetinkaya-Rundel and Barr, OpenIntro Statistics (CC BY-SA), chapters on foundations for inference; de Smith, M. J., Statistical Analysis Handbook (2024 edition, statsref.com).
Answer key
Example B (gaps). Step 1: the sample proportion of weekly users among 100 students. Step 2: and . Step 3: . Step 4: and . Step 5: about 5% of samples would exceed 48%, so a result of 49% would be unusual if p really were 0.40, and worth a second look (it is the kind of result a hypothesis test would flag).
Exercise C.
- Centre . .
- South higher means . , so
(R
pnorm(-4 / sqrt(8))). About 8% of pairs of samples would show the South campus ahead even though its population mean is 4 points lower. - Each sample mean has its own random error, and errors from independent samples do not cancel on average: for independent A and B.
Self-test.
- A parameter is a fixed population number (usually unknown); a statistic is computed from a sample and varies. The SD measures the spread of individual values; the SE measures the spread of a statistic across samples.
- , , . The SE is proportional to : four times the sample size halves it (16 to 64), and nine times the sample size cuts it to a third (16 to 144).
- The CLT is about the distribution of the sample mean, not of the data. Skewed data stay skewed; with n = 200 the sampling distribution of the mean income may well be close to normal.
- , which is below 10, so the normal approximation is poor. Use an exact binomial method or a Wilson interval (academic/stats-proportion-tests).
- Because s is itself random and often underestimates in small samples, so is too narrow. Simulation: 88.0% (R) and 88.4% (Python) coverage, versus 95.0% and 95.3% with the t critical value for df = 4.
- SEs: (a) ; (b) ; (c) . So (a) and (c) tie at 2, and (b) is largest at 3.
Revision history
| Version | Date | Author | Change |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [Your name] | First version from template |
| [0.2] | YYYY-MM-DD | [Your name] | [Added my n = 100 simulation results] |
Plantillas relacionadas
Probability Distributions Reference Sheet Template (Statistics, R and Python)
Distributions reference: 16 discrete and continuous distributions with pmf/pdf, support, mean, variance and uses, a relationship map, R d/p/q/r and scipy.stats equivalents with parameterisation traps, verified lookups and a which-distribution self-test
AcadémicasSampling Plan Template (Statistics, Survey Design, R and Python)
Target population, frame and unit; probability and non-probability designs; bias sources; margin of error with finite population correction; seeded stratified sampling in R and Python
AcadémicasStatistical Analysis Plan Template (Statistics, Thesis or Project)
Statistical analysis plan for a thesis or project: estimands, hypotheses, sample size, primary model, pre-set assumption fallbacks, missing data, multiplicity, sensitivity, deviations log