Probability & Statistics · Sampling distribution

Sampling distribution

The sampling distribution of a statistic is the distribution of its values over repeated independent samples of size n from a population: one value, one dot, per sample. Its centre against the true value is the bias; its spread is the standard error.

The sampling distribution in this visualization

A statistic is a number computed from a sample, such as its mean or median. Draw independent samples of the same size nn from one population again and again, compute the statistic each time, and the values form its sampling distribution. Its expected value minus the true value is the bias; its standard deviation is the standard error. The three layers keep three distributions apart: the population, the nn values of one sample, and the sampling distribution, one dot per sample.

Why does one sample stay wide while the means close in? A sample is a rough copy of the population, so as nn grows its standard deviation ss settles near the population’s σ\sigma rather than shrinking. The mean of nn independent values behaves differently: values above and below the centre partly cancel, and for any population with a finite variance Var⁡(xˉ)=σ2/n\operatorname{Var}(\bar x) = \sigma^2/n, so the standard error of the mean is σ/n\sigma/\sqrt{n}. Four times the sample size halves it. The standard error is therefore not the spread of a sample: it says how much the mean would move from one sample to the next. Why the means also take a bell shape is the central limit theorem.

Why does the sample variance divide by n−1n - 1? Every sample satisfies ∑(x−μ)2=∑(x−xˉ)2+n(xˉ−μ)2\sum (x - \mu)^2 = \sum (x - \bar x)^2 + n(\bar x - \mu)^2. The sum of squared deviations is smallest when measured from the sample’s own mean; it falls short of the sum measured from the true mean by n(xˉ−μ)2n(\bar x - \mu)^2, whose average is nn times the variance of xˉ\bar x: exactly σ2\sigma^2. So ∑(x−xˉ)2\sum (x - \bar x)^2 averages (n−1)σ2(n - 1)\sigma^2, dividing by n−1n - 1 makes s2s^2 unbiased, and dividing by nn falls short by σ2/n\sigma^2/n on average. The correction is for the variance only: because the square root bends down, ss itself still underestimates σ\sigma on average (for normal data with n=5n = 5, by about 6%). The maximum misses for a plainer reason: with the uniform population every value is below 100, so the largest value of a sample falls short of 100 on average.

Is the mean always the better estimate of the centre? It depends on the population. For a symmetric population the mean and the median are both centred on the true centre, so the better one is the one with the smaller standard error. With normal data the median’s is larger, for large nn about π/2≈1.25\sqrt{\pi/2} \approx 1.25 times the mean’s; with Laplace data, whose tails are heavier, it is smaller, about 1/2≈0.711/\sqrt{2} \approx 0.71 times. One extreme value moves the mean but barely moves the median, and heavy tails produce extreme values often. For a skewed population the two may estimate different numbers: the exponential population here has mean 50 and median 40+10ln⁡2≈46.9340 + 10\ln 2 \approx 46.93.

Things to notice

  • The yellow dots and bars are one seeded simulation; the ink curves are exact distributions (thin dashes where they are computed numerically). “Simulation shows an offset” describes this run only; whether a statistic is biased is its theoretical bias.

Controls

  • Changing the statistic or the divisor recomputes the same samples, so the run continues; changing nn or the population clears it.

Related