The mean $\bar{X}$ of a random sample of $n$ is centered on the population mean, $E[\bar{X}] = \mu$, with or without replacement. Its standard deviation, the standard error, is $\sigma/\sqrt{n}$ for independent draws and $\frac{\sigma}{\sqrt{n}}\sqrt{(N - n)/(N - 1)}$ for a simple random sample from $N$ without replacement. This article proves all three, checks them on every sample of five NHANES adults, and simulates them on 5,247 blood pressures: means of 25 had standard deviation 4.016 against $\sigma/\sqrt{n} = 4.025$ mm Hg. The correction matters only when the sample is a large share of the population. The estimate $s/\sqrt{n}$ misses the standard error by 30% or more in one sample of 25 in ten. The mean is exactly normal for a normal population, and otherwise its skewness falls as $1/\sqrt{n}$.
A health department measures the systolic blood pressure of 25 adults drawn at random from the population it serves, and reports their mean. Had it drawn a different 25 adults, it would have reported a different mean. So the reported mean is one draw from a whole range of possible means. Where is that range centered, and how wide is it? It is centered on the mean of the population, and its standard deviation is the population's divided by $\sqrt{n}$, here by 5. This article proves both statements.
We can watch the range directly. Treat the 5,247 adults of the National Health and Nutrition Examination Survey (NHANES) of 2017 to 2018 (National Center for Health Statistics, 2020) as the population. Their mean is 126.36 mm Hg. Five samples of 25 drawn from them give (all values in mm Hg):
| Sample | Mean | Median | Standard deviation | Smallest | Largest |
|---|---|---|---|---|---|
| 1 | 122.39 | 124.00 | 17.08 | 92.7 | 176.0 |
| 2 | 125.20 | 122.67 | 17.38 | 94.0 | 158.7 |
| 3 | 131.49 | 124.67 | 27.43 | 101.3 | 217.3 |
| 4 | 130.36 | 127.33 | 22.84 | 99.3 | 188.7 |
| 5 | 127.81 | 128.00 | 21.24 | 93.3 | 175.3 |
None of the five means equals 126.36, and they range over 9 mm Hg. Each is a reasonable estimate, and each is wrong by an amount the department cannot know. What can be known is how far a mean of 25 tends to fall from the truth, because the variation from sample to sample follows rules.
The distribution of a statistic over all possible samples is its sampling distribution. The standard deviation of the sampling distribution of a mean is the standard error of the mean. This article is the course's home for both ideas. The confidence intervals and hypothesis tests of later units are statements about this sampling distribution, and they build on the results proved here.
First we separate three distributions that are easy to confuse, and list every sample of a population of five. Then we prove where sample means are centered and how widely they spread, with and without replacement. Finally we separate the standard error from the standard deviation and look at the shape of the sampling distribution. The proofs use the expectation and variance rules of Random Variables, Expectation and Variance.
Three distributions
Three different distributions are involved, and most confusion about sampling comes from mixing them up.
- The population distribution is the distribution of the measurement over everyone of interest. Here it is the systolic pressure of the 5,247 adults. It has mean $\mu = 126.36$ mm Hg, standard deviation $\sigma = 20.12$ mm Hg and a long right tail, with skewness 1.04. Because this is a complete population, $\sigma$ uses the divisor $N$ (see Measures of Center and Spread). The summaries $\mu$ and $\sigma$ are parameters: fixed numbers, usually unknown.
- The distribution of a sample is the distribution of the $n$ values actually observed. It is a rough, small-scale copy of the population distribution. Its summaries $\bar{x}$ and $s$ are statistics, numbers computed from data.
- The sampling distribution of a statistic is the distribution of the values the statistic would take over all possible samples of size $n$. It is not a distribution of people at all. Each point in it is the mean of a whole sample.
These adults are treated as a complete population to draw samples from, as in Confidence Intervals and Coverage. That is a teaching device. NHANES is itself a sample of the US population, designed so that national estimates use sampling weights, and nothing here estimates national blood pressure. Its value is that the population is real, not a textbook curve, and its parameters are known exactly. So every claim about the sampling distribution can be checked against the truth.
Example (a larger sample changes one distribution). Suppose the department samples 64 adults instead of 25. Of the three distributions, only the sampling distribution changes in a predictable way. The population does not change. The sample becomes a less ragged copy of it, still skewed and still with a standard deviation of about 20 mm Hg. The sampling distribution stays centered on 126.36 but narrows, from a standard deviation of about 4.0 mm Hg to about 2.5, as the simulation below confirms.
Notation. Before a sample is drawn, its observations are random variables $X_1, \ldots, X_n$. Their mean
$$\bar{X} = \frac{1}{n}\sum_{i=1}^{n} X_i$$
is a random variable too, written with a capital letter. The value it takes for one particular sample is $\bar{x}$. The mean and standard deviation of the sampling distribution of $\bar{X}$ are written $\mu_{\bar{X}}$ and $\sigma_{\bar{X}}$.
How the sample is drawn matters. In a simple random sample, every subset of $n$ people is equally likely to be the sample. Drawn one person at a time, that means each draw is equally likely to be any of the people not yet drawn. This is sampling without replacement. If instead each draw is equally likely to be anyone in the population, including people already drawn, the sampling is with replacement. Then the draws are independent, each with the population distribution. The two schemes have the same mean, and almost the same standard error when the sample is a small fraction of the population. To see the difference exactly, we need a population small enough to list every sample. (Other designs, such as stratified, systematic and cluster samples, have standard errors of their own; Data Collection and Sampling compares them by simulation on NHANES adults.)
Every sample of a small population
For a small enough population, the sampling distribution can be written down completely. Take five of the NHANES adults as a population in their own right, with systolic pressures
$$134.67, \quad 114.00, \quad 136.00, \quad 89.33, \quad 112.67 \text{ mm Hg}.$$
Their mean is $\mu = 117.33$ and their variance, with divisor 5, is $\sigma^2 = 293.16$, so $\sigma = 17.12$ mm Hg. Drawing two of them without replacement, there are $\binom{5}{2} = 10$ possible samples, each with probability $1/10$:
| Sample | Values | Mean $\bar{x}$ |
|---|---|---|
| adults 1, 2 | 134.67, 114.00 | 124.33 |
| adults 1, 3 | 134.67, 136.00 | 135.33 |
| adults 1, 4 | 134.67, 89.33 | 112.00 |
| adults 1, 5 | 134.67, 112.67 | 123.67 |
| adults 2, 3 | 114.00, 136.00 | 125.00 |
| adults 2, 4 | 114.00, 89.33 | 101.67 |
| adults 2, 5 | 114.00, 112.67 | 113.33 |
| adults 3, 4 | 136.00, 89.33 | 112.67 |
| adults 3, 5 | 136.00, 112.67 | 124.33 |
| adults 4, 5 | 89.33, 112.67 | 101.00 |
These ten means, each with probability $1/10$, are the sampling distribution of $\bar{X}$ for this population and this design. Their average is 117.33, exactly the population mean. Their variance is 109.93.
Example (the same five adults, drawn with replacement). Drawing with replacement makes the variance of the sample means larger than 109.93. It adds samples in which one adult is drawn twice, such as adult 4 twice, with mean 89.33, more extreme than any mean in the table. With replacement there are $5^2 = 25$ equally likely ordered samples. Their 25 means again average 117.33, but their variance is 146.58, which is exactly $\sigma^2/2$. Without replacement the variance, 109.93, is not $\sigma^2/2$ but three quarters of it. The next three sections prove that none of this is a coincidence: the average is $\mu$ for both designs, the variance with replacement is $\sigma^2/n$, and the factor of three quarters is $(N - n)/(N - 1)$.
The center: the sample mean is unbiased
Here is the idea in one sentence: each draw is, on average, the population mean, so the average of the draws is too.
Proposition. If each $X_i$ has the population distribution, so that $E[X_i] = \mu$ for every $i$, then $E[\bar{X}] = \mu$.
Proof. The expected value of a sum is the sum of the expected values, and a constant factor comes outside (Random Variables, Expectation and Variance proves both rules). So
$$E[\bar{X}] = \frac{1}{n}\sum_{i=1}^{n} E[X_i] = \frac{1}{n}\cdot n\mu = \mu. \qquad \square$$
The proof does not use independence. So it covers sampling without replacement as well, provided each draw has the population distribution. It does, by symmetry. Drawing all $N$ people one at a time without replacement puts them in a random order, and each of the $N!$ orderings is equally likely, since each has probability $\frac{1}{N}\cdot\frac{1}{N-1}\cdots\frac{1}{1}$. The sample is the first $n$ people in the order. A given person occupies position $i$ in exactly $(N - 1)!$ of the orderings, one for each arrangement of the others. So the $i$th person drawn is any given person $k$ with probability $(N-1)!/N! = 1/N$, and $E[X_i] = \frac{1}{N}\sum_k x_k = \mu$. The five adults confirm it for both designs: the means average 117.33 with and without replacement.
A statistic whose expected value equals the parameter it estimates is unbiased. The sample mean is unbiased for the population mean under random sampling of either kind. Averaged over all possible samples, it is right.
A common misreading takes "unbiased" to mean "close". It says nothing about any one sample, whose mean may be well off: sample 3 of the opening table missed by more than 5 mm Hg. It also says nothing about samples that are not random. Confidence Intervals and Coverage shows what happens when samples come only from adults aged 60 and over: every mean is centered on the wrong value, and no formula in this article can detect it.
But the department has one sample, not the average of all of them. It needs to know how far a single mean typically falls from $\mu$.
The spread: the standard error is sigma over root n
Here is the idea. A sum of $n$ independent values has $n$ times the variance of one value. Dividing the sum by $n$ divides the variance by $n^2$. So the variance of the mean is $\sigma^2/n$, and its standard deviation falls only with $\sqrt{n}$.
Proposition. If $X_1, \ldots, X_n$ are independent, each with variance $\sigma^2$, then
$$\operatorname{Var}(\bar{X}) = \frac{\sigma^2}{n}, \qquad \sigma_{\bar{X}} = \frac{\sigma}{\sqrt{n}}.$$
Proof. For independent variables the variance of a sum is the sum of the variances. (Random Variables, Expectation and Variance proves this from the vanishing of the covariances.) Multiplying a variable by a constant $c$ multiplies its variance by $c^2$. So
$$\operatorname{Var}(\bar{X}) = \frac{1}{n^2}\operatorname{Var}\Big(\sum_{i=1}^n X_i\Big) = \frac{1}{n^2}\sum_{i=1}^n \operatorname{Var}(X_i) = \frac{1}{n^2}\cdot n\sigma^2 = \frac{\sigma^2}{n},$$
and the standard deviation is the square root. $\square$
Grinstead and Snell (1997, Theorem 6.9) state it for an independent trials process, and it is the most used formula of the course. The standard deviation of the sampling distribution is called the standard error of the mean. The name keeps the word "deviation" for individuals and "error" for estimates.
Unlike the center, the spread needs independence. The proof drops the covariances between the $X_i$, which are zero for independent draws; for draws without replacement they are not, as the next section shows. With replacement the draws are independent, which is why the 25 ordered samples of the five adults had variance exactly $\sigma^2/2$.
The formula says three things.
- The standard error is proportional to $\sigma$. A more variable population gives more variable means.
- It does not depend on the size of the population, only on the size of the sample.
- It shrinks with the square root of $n$, not with $n$. A sample four times as large halves the standard error, and one a hundred times as large cuts it by a factor of ten. That square-root law is why precision is expensive.
Example (the price of a standard error of 1.0). For the department's samples of 25, the standard error is about 4.0 mm Hg. Bringing it down to 1.0 takes about 400 adults: cutting the standard error by a factor of four needs a sample $4^2 = 16$ times as large, and $16 \times 25 = 400$.
The simulation checks the formula on the full NHANES population. For each sample size, 10,000 samples were drawn with replacement for each of 30 random seeds. The table gives the median over the seeds of the average and standard deviation of the 10,000 means, with the interquartile range (IQR) of the 30 results.
| $n$ | Average of the means | Standard deviation of the means (IQR over seeds) | $\sigma/\sqrt{n}$ |
|---|---|---|---|
| 1 | 126.35 | 20.141 (20.102 to 20.171) | 20.125 |
| 4 | 126.38 | 10.056 (10.016 to 10.096) | 10.062 |
| 16 | 126.36 | 5.021 (5.005 to 5.037) | 5.031 |
| 25 | 126.35 | 4.016 (3.990 to 4.047) | 4.025 |
| 64 | 126.37 | 2.521 (2.504 to 2.531) | 2.516 |
Every row is centered on 126.36, and every spread matches $\sigma/\sqrt{n}$ to within the noise of the simulation.
Sampling without replacement: the finite population correction
Real samples are drawn without replacement, so that nobody is measured twice. The draws are then dependent, and the proof above no longer applies. Here is the idea in one sentence: if the first person drawn has a high pressure, fewer high pressures remain for the second draw, so high and low draws tend to offset each other. The dependence is negative, and it makes the sample mean less variable than $\sigma/\sqrt{n}$, as the five adults showed.
Proposition. For a simple random sample of $n$ drawn without replacement from a population of $N$ values with mean $\mu$ and variance $\sigma^2 = \frac{1}{N}\sum_k (x_k - \mu)^2$,
$$\operatorname{Var}(\bar{X}) = \frac{\sigma^2}{n}\cdot\frac{N - n}{N - 1}.$$
The plan of the proof: keep the covariances that the independent case dropped, show that every pair of draws has the same covariance, and compute it from the fact that deviations from the mean sum to zero.
Proof. The variance of a sum, without assuming independence, is the sum of the variances plus the covariances of all ordered pairs, as Random Variables, Expectation and Variance proves:
$$\operatorname{Var}\Big(\sum_{i=1}^n X_i\Big) = \sum_{i=1}^n \operatorname{Var}(X_i) + \sum_{i \ne j} \operatorname{Cov}(X_i, X_j).$$
Each $X_i$ has the population distribution, as shown in the section on the center, so $\operatorname{Var}(X_i) = \sigma^2$. For the covariance, take two positions $i \ne j$ and two different people $k$ and $l$. Person $k$ is in position $i$ and person $l$ in position $j$ in exactly $(N - 2)!$ of the $N!$ equally likely orderings, one for each arrangement of the other $N - 2$ people. So the probability that person $k$ is drawn in position $i$ and person $l$ in position $j$ is
$$\frac{(N-2)!}{N!} = \frac{1}{N(N-1)}:$$
the pair of draws is equally likely to be any of the $N(N-1)$ ordered pairs of two different people. The covariance is $E[(X_i - \mu)(X_j - \mu)]$, since both draws have mean $\mu$, so every pair of draws has the same covariance,
$$c = \operatorname{Cov}(X_i, X_j) = \frac{1}{N(N-1)}\sum_{k \ne l}(x_k - \mu)(x_l - \mu).$$
The sum over pairs of different people is the sum over all pairs minus the pairs with $k = l$:
$$\sum_{k \ne l}(x_k - \mu)(x_l - \mu) = \Big(\sum_k (x_k - \mu)\Big)^2 - \sum_k (x_k - \mu)^2 = 0 - N\sigma^2,$$
because deviations from the mean sum to zero. Hence $c = -\sigma^2/(N - 1)$. There are $n(n-1)$ ordered pairs among the $n$ draws, so
$$\operatorname{Var}\Big(\sum_{i=1}^n X_i\Big) = n\sigma^2 - n(n-1)\frac{\sigma^2}{N-1} = n\sigma^2\Big(1 - \frac{n-1}{N-1}\Big) = n\sigma^2\,\frac{N - n}{N - 1},$$
and dividing by $n^2$ gives the result. $\square$
The square root of the factor, $\sqrt{(N - n)/(N - 1)}$, is the finite population correction. (Expectation, Variance and Covariance shows that the covariance $-\sigma^2/(N - 1)$ found in the proof is the most negative one that $N$ variables with a common variance and a common correlation can have.)
Back to the five adults. The covariance of two draws is $c = -293.16/4 = -73.29$. That is exactly the average of $(x_k - \mu)(x_l - \mu)$ over the 20 ordered pairs of different adults. The variance of a mean of two is $146.58 \times 3/4 = 109.93$, as enumerated: the three quarters is $(N - n)/(N - 1) = 3/4$.
Sampling texts often use the population variance with divisor $N - 1$, $S^2 = N\sigma^2/(N-1)$, and write the result as $\operatorname{Var}(\bar{X}) = (1 - n/N)\,S^2/n$ (Cochran, 1977, in its chapter on simple random sampling), the form in which Survey Sampling Designs proves it and builds stratified and cluster designs on it. The two forms agree:
$$\Big(1 - \frac{n}{N}\Big)\frac{S^2}{n} = \frac{N - n}{N}\cdot\frac{N\sigma^2}{(N-1)\,n} = \frac{\sigma^2}{n}\cdot\frac{N - n}{N - 1}.$$
The same factor multiplies the binomial variance when a count is taken without replacement. A count is $n\bar{X}$ for a population of zeros and ones, with $\sigma^2 = p(1 - p)$, so its variance is $n^2\operatorname{Var}(\bar{X}) = np(1-p)(N - n)/(N - 1)$. Its distribution is the hypergeometric distribution of The Normal Approximation to the Binomial.
How much does the correction matter? It depends on the sampling fraction $n/N$. The script drew 2,000 samples without replacement from the 5,247 adults, for each of 30 seeds and each sample size:
| $n$ | $n/N$ | Standard deviation of the means (IQR over seeds) | $\sigma/\sqrt{n}$ | Corrected |
|---|---|---|---|---|
| 25 | 0.005 | 4.045 (4.001 to 4.068) | 4.025 | 4.016 |
| 500 | 0.095 | 0.852 (0.844 to 0.864) | 0.900 | 0.856 |
| 1,000 | 0.191 | 0.573 (0.567 to 0.577) | 0.636 | 0.573 |
| 2,624 | 0.500 | 0.277 (0.273 to 0.280) | 0.393 | 0.278 |
| 4,000 | 0.762 | 0.155 (0.154 to 0.157) | 0.318 | 0.155 |
| 5,000 | 0.953 | 0.062 (0.061 to 0.062) | 0.285 | 0.062 |
| 5,247 | 1 | 0 | 0.278 | 0 |
Example (a town and a country). One department samples 25 adults from a town of 5,247 adults. Another samples 25 from a whole country. If the two populations have the same $\sigma$, neither sample mean is more precise than the other, for practical purposes. For 25 out of 5,247 the correction changes the standard error by 0.2%, less than the simulation's own noise, and for a country it is smaller still. Until the sample is a large share of the population, only the sample size matters. At half the population, by contrast, the correction shrinks the standard error by 29%, and a sample of everyone has no sampling error at all, which the uncorrected formula misses.
The usual practice follows. The correction is ignored when the sampling fraction is small, as in nearly every medical study, where the population is a whole country or an open-ended stream of future patients. It is applied when a large share of a finite population is sampled, such as the records of one hospital or the beds of one ward. When the population is a process rather than a list, there is no $N$, and the independent-draws formula applies.
The standard error and the standard deviation
The two are easy to confuse: both are standard deviations, and both are reported next to a mean. They answer different questions.
- The standard deviation $\sigma$ (estimated by $s$) describes how much individuals vary. It does not shrink as the sample grows; a larger sample only estimates it more precisely.
- The standard error $\sigma/\sqrt{n}$ describes how much the sample mean varies from sample to sample, that is, how precisely the mean is estimated. It shrinks toward zero as the sample grows.
In practice $\sigma$ is unknown. The standard error is then estimated by $s/\sqrt{n}$, the estimated standard error, which is often also just called the standard error. It is an estimate of the standard error, not the standard error itself, and it varies from sample to sample, as measured below.
Example (a common misstatement). "The standard error measures how much different sample means vary from each other." The precise statement is that it measures the typical distance of a sample mean from the population mean. Two independent sample means $\bar{X}_1$ and $\bar{X}_2$ of the same size differ from each other by more. The variance of a difference of independent variables is the sum of their variances (Random Variables, Expectation and Variance), so
$$\operatorname{Var}(\bar{X}_1 - \bar{X}_2) = \frac{\sigma^2}{n} + \frac{\sigma^2}{n}, \qquad \text{a standard deviation of } \sqrt{2}\,\frac{\sigma}{\sqrt{n}}.$$
That is why a second study's mean falls inside the first study's 95% interval only about 83% of the time, as Confidence Intervals and Coverage shows.
Example (one sample reported two ways). Sample 1 of the opening table has mean 122.4, standard deviation 17.1 and estimated standard error $17.1/\sqrt{25} = 3.4$ mm Hg. Twenty of its 25 adults lie within one standard deviation of the mean, and only five within one standard error. So a report of "122.4 ± 3.4 mm Hg", read as a description of the adults, would make them look far more alike than they are.
Altman and Bland (2005) make the same distinction for medical papers. To say how widely scattered measurements are, use the standard deviation. The standard error measures the precision of the mean and is used mainly to compute confidence intervals and $P$ values. They also point out that "mean ± value" without saying which value is ambiguous, and cite a review of 88 articles published in 2002 in which 12 did not say. The safe practice is to report the standard deviation to describe data and a confidence interval to describe the precision of a mean, and to label both. The same distinction separates an effect size from a test statistic: a difference divided by the standard deviation does not grow with the sample, while one divided by the standard error does (Effect Sizes and Standardized Differences). Software adds a trap of its own: NumPy's default standard deviation divides by $n$, while scipy's standard error of the mean uses $n - 1$, as Inferential Statistics in Python shows on a sample of NHANES adults.
The estimated standard error has a sampling distribution too. Over the script's 10,000 samples of 25 (median of 30 seeds), the true standard error is 4.025 mm Hg. The estimates had:
- median 3.893;
- quartiles 3.414 and 4.428;
- 5th and 95th percentiles 2.811 and 5.292.
So one sample in ten misjudges the precision of its own mean by 30% or more, in one direction or the other. The estimates are low more often than high, for two reasons. First, for independent draws (as in the simulation, which samples with replacement) $s^2$ is unbiased for $\sigma^2$ (Confidence Intervals for a Mean: z and t proves it), but its square root is not unbiased for $\sigma$. Since $s$ is not constant from sample to sample, $\operatorname{Var}(s) = E[s^2] - (E[s])^2 > 0$, so $(E[s])^2 < E[s^2] = \sigma^2$ and $E[s] < \sigma$ (strictly; equality would need $s$ to take one value in every sample). Second, in a right-skewed population most samples of 25 miss the long tail that contributes much of $\sigma$. Replacing $\sigma$ by $s$ in a standardized mean is what makes Student's $t$ distribution necessary, the subject of Confidence Intervals for a Mean: z and t.
The shape of the sampling distribution
So far we have the center and the spread, and they hold for every population. The shape does not, though it follows a pattern.
If the population is normal, the sample mean is exactly normal for every $n$. A sum of independent normal variables is normal. That fact is cited, not proved here (Grinstead and Snell, 1997, §10.3, prove it with moment generating functions for two summands, and induction gives any number). Moment Generating and Characteristic Functions proves it from the product rule for moment generating functions, given the uniqueness theorem for those functions, which it cites. A normal variable divided by a constant is normal too, by the proposition on linear changes of scale in The Normal Distribution. In this site's notation, where the second argument is the standard deviation, $\bar{X} \sim N(\mu, \sigma/\sqrt{n})$.
If the population is not normal, the sampling distribution inherits some of its shape and loses it as $n$ grows. The figures above show it: the means of 4 adults keep a visible right tail, the means of 64 almost none. The simulation measured the skewness of the means, which falls in proportion to $1/\sqrt{n}$:
| $n$ | Skewness of the means (IQR over seeds) | Population skewness $/\sqrt{n}$ |
|---|---|---|
| 1 | 1.034 (1.011 to 1.063) | 1.038 |
| 4 | 0.523 (0.502 to 0.542) | 0.519 |
| 16 | 0.251 (0.239 to 0.270) | 0.259 |
| 25 | 0.207 (0.189 to 0.217) | 0.208 |
| 64 | 0.137 (0.119 to 0.149) | 0.130 |
Example (halving the skewness). Means of 4 adults have skewness 0.52. Halving it takes a sample of sixteen: skewness falls with $\sqrt{n}$, so halving it takes four times the sample. The table agrees: 0.251 at $n = 16$.
The skewness of a mean of $n$ independent observations is the population skewness divided by $\sqrt{n}$. The Central Limit Theorem proves that, and states the theorem that the whole distribution, not just its skewness, approaches the normal; Moment Generating Functions and Slutsky's Theorem proves the theorem for populations with a moment generating function, which include every finite population sampled with replacement. For blood pressure the approach is quick. For strongly skewed measurements it can be slow enough to matter in studies of ordinary size, as The Central Limit Theorem shows for C-reactive protein.
Putting the three results together, with the shape taken from the central limit theorem of the next article: for independent observations and a large enough $n$,
$$\bar{X} \approx N\!\left(\mu,\ \frac{\sigma}{\sqrt{n}}\right), \qquad Z = \frac{\bar{X} - \mu}{\sigma/\sqrt{n}} \approx N(0, 1).$$
This standardized mean is the starting point of the confidence interval in Confidence Intervals and Coverage.
Other statistics have sampling distributions too
Every statistic computed from a random sample has a sampling distribution, and the ideas above apply to each. Three come up in the course.
- The sample proportion. A proportion is the mean of observations coded 0 and 1, so it is a special case of this article, with $\mu = p$ and $\sigma^2 = p(1 - p)$. The Normal Approximation to the Binomial works it out, including the finite population correction.
- The sample variance. For a normal population, its sampling distribution is a scaled chi-squared distribution, derived in The Chi-Squared and t Distributions.
- The sample median, treated next.
For a statistic whose sampling distribution has no formula, the bootstrap estimates it from one sample by resampling that sample, the plug-in principle applied to a sampling distribution; The Plug-In Principle and Why the Bootstrap Works proves when this works.
The sample median
Example (the median varies more than the mean). For samples of 25 of these adults, the mean varies less from sample to sample than the median. Over the script's samples of 25, the medians had a standard deviation of 4.454 mm Hg, against 4.030 for the means of the same samples. The ratio is 1.108 (IQR 1.103 to 1.113 over the 30 seeds). The medians averaged 123.30 mm Hg, close to the population median of 123.33. So the median estimates a different parameter, the population median, and estimates it less precisely.
For a normal population the gap is wider. The same simulation, with samples of 25 from a standard normal population, gave a ratio of 1.242, approaching $\sqrt{\pi/2} = 1.2533$ for large samples. The number $\sqrt{\pi/2}$ comes from the large-sample distribution of the median, which the next paragraphs derive in outline.
Here is the plan. The median of a sample is below a point exactly when more than half the observations are. A count of observations below a point is binomial, so the normal approximation to the binomial gives the distribution of the median.
The derivation, in outline. Take a continuous population with distribution function $F$, median $m$ and a density $f$ that is continuous and positive at $m$, and an odd sample size $n$.
- The sample median is at most $m + d$ exactly when more than half the observations are at most $m + d$, since for odd $n$ the median is the middle observation.
- Each observation is at most $m + d$ with probability $F(m + d)$, which is close to $\tfrac12 + f(m)\,d$ when $d$ is small, because $F(m) = \tfrac12$ and $F' = f$.
- The number of such observations is binomial, so their proportion has mean $F(m + d)$, close to $\tfrac12 + f(m)\,d$, and standard deviation $\sqrt{F(m+d)(1 - F(m+d))/n}$, close to $1/(2\sqrt{n})$.
- By the normal approximation to the binomial, the probability that this proportion exceeds one half is close to $\Phi\Big(\dfrac{f(m)\,d}{1/(2\sqrt{n})}\Big) = \Phi\big(2f(m)\,d\sqrt{n}\big)$.
That is the distribution function, at $m + d$, of a normal variable centered on $m$ with standard deviation $1/(2f(m)\sqrt{n})$. A normal population has $f(m) = 1/(\sigma\sqrt{2\pi})$, so the median's standard error is $\sigma\sqrt{\pi/2}/\sqrt{n}$. Its ratio to $\sigma/\sqrt{n}$ is $\sqrt{\pi/2}$.
The outline is not a proof. Each "close to" hides a limit: the distances that matter are $d = x/\sqrt{n}$, which shrink as $n$ grows, so step 4 applies the normal approximation to a binomial whose success probability changes with $n$. The Berry–Esseen bound of The Central Limit Theorem justifies that step, because it bounds the error of the approximation for every success probability near one half at once. The theorem itself, that $\sqrt{n}$ times the difference between the sample median and $m$ approaches a normal distribution with standard deviation $1/(2f(m))$, is cited: van der Vaart (1998, Chapter 21, on quantiles and order statistics) proves it for sample quantiles in general, with asymptotic variance $p(1 - p)/f(\xi_p)^2$ for the $p$-quantile $\xi_p$, which is $1/(4f(m)^2)$ for the median. The script's simulation of normal samples, with its ratio of 1.242 at $n = 25$, is consistent with it.
That ratio is one reason the mean is preferred when the population is close to normal. Its square, $\pi/2$, reappears later in the course. The sign test, a test about the median, pays that price in sample size relative to the $t$-test for normal data: its efficiency is $2/\pi = 0.637$.
What the formulas assume
Every result in this article assumed a random sample. The standard error formula also assumed independent draws or, without replacement, the correction. Two kinds of departure are common.
- Clustered observations. Patients within hospitals, children within schools and repeated measurements on one person are positively correlated. Then the standard error of the mean is larger than $\sigma/\sqrt{n}$, by a factor that The Binomial Distribution derives as the design effect and measures on NHANES's repeated blood pressure readings. The Central Limit Theorem shows a case where correlation keeps the standard error from shrinking to zero however large the sample.
- Samples that are not random. No formula repairs them. The mean of a sample from the wrong population is unbiased for the wrong mean.
Example (a common misstatement). "The standard error of a mean is $\sigma/\sqrt{n}$." The precise statement carries its condition: $\sigma/\sqrt{n}$ is the standard error for independent observations. For sampling without replacement it is multiplied by the finite population correction derived above, which matters when the sample is a large share of the population. For positively correlated observations it is too small. And the quantity computed from data, $s/\sqrt{n}$, is an estimate of it with a sampling distribution of its own, wide enough in samples of 25 that one sample in ten misjudges its precision by 30% or more.
Worked problems
The first problem is an exercise from the course text's chapter on the sampling distribution of the mean (Pagano, Gauvreau and Mattie, 2022), restated in our own words with its data. The other two are posed on this article's five adults and on the NHANES population. The script named under "In Python" checks every number.
Problem 1 (mean weights of samples of 25 men). The weights of adult males in the United States are approximately normal with mean 172.2 pounds and standard deviation 29.8 pounds. (a) Describe the distribution of the means of samples of size 25 drawn from this population. (b) Find the upper bound for 90% of the mean weights of such samples. (c) Find the lower bound for 80% of the mean weights. (d) A single random sample of 25 has mean weight 190 pounds. How likely is such a result, and what follows?
Solution. (a) Take the population as exactly normal and the draws as independent, which is accurate for a sample that is a tiny share of a national population. Then the sample mean is exactly normal for this and every sample size, with mean $\mu = 172.2$ pounds and standard error
$$\frac{\sigma}{\sqrt{n}} = \frac{29.8}{\sqrt{25}} = 5.96 \text{ pounds}.$$
So $\bar{X} \sim N(172.2, 5.96)$: centered where the individual weights are, and one fifth as spread out.
(b) Ninety percent of a normal distribution lies below the point with z-score $z_{0.90} = 1.2816$. So 90% of the sample means are below
$$172.2 + 1.2816 \times 5.96 = 179.84 \text{ pounds}.$$
(c) Eighty percent of a normal distribution lies above the point with z-score $-z_{0.80} = -0.8416$. So 80% of the sample means are above
$$172.2 - 0.8416 \times 5.96 = 167.18 \text{ pounds}.$$
(d) The z-score of the observed mean is $(190 - 172.2)/5.96 = 2.987$, and
$$P(\bar{X} \ge 190) = 1 - \Phi(2.987) = 0.0014,$$
about one sample in 709. An individual man of 190 pounds is unremarkable, with z-score $(190 - 172.2)/29.8 = 0.60$; a mean of 190 over 25 men is not. What follows is a choice between two explanations: either a sample of the rare kind was drawn, or the 25 men were not a random sample from a population with mean 172.2 pounds. The probability measures how hard the first explanation is to hold. It does not say which is true, and it is the reasoning that Hypothesis Testing makes formal.
Problem 2 (every sample of three of the five adults). For the population of five adults in this article, list every sample of three drawn without replacement, and find the mean and variance of the sample mean by enumeration and from the formulas.
Solution. There are $\binom{5}{3} = 10$ samples, each with probability $1/10$:
| Sample | Mean $\bar{x}$ | Sample | Mean $\bar{x}$ |
|---|---|---|---|
| adults 1, 2, 3 | 128.22 | adults 1, 4, 5 | 112.22 |
| adults 1, 2, 4 | 112.67 | adults 2, 3, 4 | 113.11 |
| adults 1, 2, 5 | 120.44 | adults 2, 3, 5 | 120.89 |
| adults 1, 3, 4 | 120.00 | adults 2, 4, 5 | 105.33 |
| adults 1, 3, 5 | 127.78 | adults 3, 4, 5 | 112.67 |
The ten means average 117.33, the population mean, as unbiasedness requires. Their variance, computed from the list, is 48.86. The formula gives the same:
$$\operatorname{Var}(\bar{X}) = \frac{\sigma^2}{n}\cdot\frac{N - n}{N - 1} = \frac{293.16}{3}\cdot\frac{5 - 3}{5 - 1} = 97.72 \times \frac{1}{2} = 48.86,$$
a standard error of 6.99 mm Hg. With replacement the variance would be 97.72; drawing three of five without replacement halves it.
There is a second route to the same number. Choosing three adults is the same as choosing the two to leave out. The five values total $5\mu$, so the mean of the three is $(5\mu - 2\bar{x}_2)/3$, where $\bar{x}_2$ is the mean of the two left out. Hence the variance for samples of three is $(2/3)^2 = 4/9$ of the variance for samples of two: $\tfrac49 \times 109.93 = 48.86$.
Problem 3 (the sample size for a standard error of 2 mm Hg). For the NHANES population of 5,247 adults, with $\sigma = 20.125$ mm Hg, find the smallest sample whose mean has a standard error of at most 2 mm Hg, (a) drawing with replacement and (b) drawing without replacement.
Solution. (a) With replacement the draws are independent, and $\sigma/\sqrt{n} \le 2$ exactly when $n \ge (\sigma/2)^2 = (20.125/2)^2 = 101.25$. The sample size must be a whole number, so $n = 102$: the standard error is 2.0025 at $n = 101$ and 1.9926 at $n = 102$.
(b) Without replacement the condition is
$$\frac{\sigma^2}{n}\cdot\frac{N - n}{N - 1} \le 2^2.$$
Multiply both sides by $n(N - 1)$ and collect the terms in $n$: $\sigma^2 N - \sigma^2 n \le 4(N - 1)n$, so
$$n \ \ge\ \frac{N\sigma^2}{4(N - 1) + \sigma^2} = \frac{5{,}247 \times 405.01}{4 \times 5{,}246 + 405.01} = \frac{2{,}125{,}087}{21{,}389.01} = 99.35.$$
So $n = 100$: the corrected standard error is 2.0036 at $n = 99$ and 1.9934 at $n = 100$. The correction saves two adults out of 102, because the sample is under 2% of the population. The complete answer is 102 with replacement and 100 without.
Summary
| Quantity | Formula |
|---|---|
| Sample mean | $\bar{X} = \frac{1}{n}\sum_{i=1}^n X_i$; observed value $\bar{x}$ |
| Center | $\mu_{\bar{X}} = E[\bar{X}] = \mu$ (any random sample) |
| Standard error, independent draws | $\sigma_{\bar{X}} = \sigma/\sqrt{n}$ |
| Without replacement from $N$ | $\sigma_{\bar{X}} = \dfrac{\sigma}{\sqrt{n}}\sqrt{\dfrac{N - n}{N - 1}}$ |
| Estimated standard error | $s/\sqrt{n}$ |
| Normal population | $\bar{X} \sim N(\mu, \sigma/\sqrt{n})$ exactly |
| Skewness of $\bar{X}$ | population skewness $/\sqrt{n}$ |
| Large $n$, any population with finite $\sigma$ | $\bar{X} \approx N(\mu, \sigma/\sqrt{n})$ |
What we have learned
A sample mean is a random quantity with a distribution of its own. It is centered on the population mean, with standard error $\sigma/\sqrt{n}$ for independent draws and a little less without replacement. The five adults showed both facts by listing every sample, and NHANES simulations confirmed them on a real, skewed population. The standard error describes the precision of a mean, not the spread of people, and in practice it is itself estimated, with error.
One matter remains: the means of 64 skewed blood pressures were nearly symmetric. The next article, The Central Limit Theorem, states the theorem behind that and establishes how large $n$ must be before it can be relied on, which depends on the skewness of the population.
In Python
The sampling distribution of a mean from a finite population can be simulated directly; rng.choice draws with replacement by default.
import numpy as np
rng = np.random.default_rng(0)
pop = np.array([134.67, 114.00, 136.00, 89.33, 112.67]) # any population
N, n = len(pop), 2
sigma2 = pop.var() # divisor N
with_repl = rng.choice(pop, (100_000, n)).mean(axis=1)
without = np.array([rng.choice(pop, n, replace=False).mean() for _ in range(100_000)])
print(with_repl.var(), sigma2 / n) # about 146.6
print(without.var(), sigma2 / n * (N - n) / (N - 1)) # about 109.9
Every number in this article is computed by tools/experiments/applied-statistics/sampling-distribution-of-the-mean.py in the site's repository, which downloads the NHANES files from the CDC and checks their checksums; the figures are drawn by tools/figures/sampling-distribution-of-the-mean.py.
References
- Altman, D. G., and Bland, J. M. (2005). Standard deviations and standard errors. BMJ, 331(7521), 903. record
- Cochran, W. G. (1977). Sampling Techniques (3rd ed.). Wiley. The chapter on simple random sampling (the variance of the sample mean and the finite population correction). record · 2 pages
- Grinstead, C. M., and Snell, J. L. (1997). Introduction to Probability (2nd rev. ed.). American Mathematical Society. Theorem 6.9 (mean and variance of an average) and §10.3 (sums of independent normal variables). record · 22 pages
- National Center for Health Statistics (2020). National Health and Nutrition Examination Survey 2017–2018: Demographic Variables and Sample Weights (DEMO_J) and Blood Pressure (BPX_J) data files. Centers for Disease Control and Prevention. https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2017 record · 109 pages
- Pagano, M., Gauvreau, K., and Mattie, H. (2022). Principles of Biostatistics (3rd ed.). CRC Press. The course text. record · 48 pages
- van der Vaart, A. W. (1998). Asymptotic Statistics. Cambridge University Press. Chapter 21 (Quantiles and order statistics). record · 8 pages
Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 12 revisions