Book contents

STATHARBOR ANALYTICS · INTRODUCTION TO STATISTICS · CHAPTER 7

Sampling Distributions and the Central Limit Theorem

Statistical inference relies on understanding how sample statistics behave when we take repeated samples from a population. The distribution of a statistic across repeated samples is called its sampling distribution. This chapter introduces sampling distributions for common statistics and the all-important central limit theorem (CLT).

Sampling Distribution of the Sample Mean

Let X1,X2,…,XnX_1, X_2, \dots, X_n be independent and identically distributed random variables with mean μ\mu and variance σ2\sigma^2. The sample mean is X‾=1n∑i=1nXi.\bar{X} = \frac{1}{n} \sum_{i=1}^n X_i.

Properties of X‾\bar{X}:

The standard error (SE) of the mean is σ/n\sigma/\sqrt{n}. In practice, we estimate σ\sigma by the sample standard deviation ss.

Central Limit Theorem

The CLT states that, for large nn, the sampling distribution of X‾\bar{X} is approximately normal with mean μ\mu and variance σ2/n\sigma^2/n regardless of the distribution of the XiX_i. More formally, as n→∞n \to \infty, X‾−μσ/n→dN(0,1).\frac{\bar{X} - \mu}{\sigma / \sqrt{n}} \xrightarrow{d} N(0,1).

The CLT justifies using normal-based confidence intervals and hypothesis tests even when the data are non-normal, provided the sample size is sufficiently large and the distribution is not extremely heavy-tailed.

Sampling Distribution of the Sample Proportion

Let XX be the number of successes in nn independent Bernoulli trials with probability pp. The sample proportion is p̂=X/n\hat{p} = X/n. Then E[p̂]=pE[\hat{p}] = p and Var(p̂)=p(1−p)/n\text{Var}(\hat{p}) = p(1-p)/n. For large nn, p̂\hat{p} is approximately normal with mean pp and variance p(1−p)/np(1-p)/n by the CLT.

Simulation: Demonstrating the CLT

Worked example

Simulating the distribution of the sample mean.

Consider a population distributed as an exponential with mean 1. We take samples of size n=50n=50 and compute the sample mean. Repeating this many times gives the sampling distribution of the mean.

import numpy as np
import matplotlib.pyplot as plt

np.random.seed(1)
n     = 50
reps  = 10000
means = []
for _ in range(reps):
    sample = np.random.exponential(scale=1.0, size=n)
    means.append(np.mean(sample))

plt.hist(means, bins=30, density=True, alpha=0.7)
plt.xlabel('Sample mean')
plt.ylabel('Density')
plt.title('Sampling distribution of the mean (Exponential population)')
plt.show()

The histogram of sample means is approximately normal even though the population distribution is skewed. Increasing the sample size nn produces a narrower distribution (smaller standard error).

Exercises

Practice

  1. Derive E[X‾]E[\bar{X}] and Var(X‾)\text{Var}(\bar{X}) from first principles for independent identically distributed random variables.

  2. Simulate the sampling distribution of the sample proportion p̂\hat{p} for a Bernoulli(p=0.3p=0.3) population with n=20n=20 and n=200n=200. Plot histograms and compare the shapes. When does the normal approximation become reasonable?

  3. For a fixed sample size nn, how does the standard error of the mean change if the variance of the population doubles? How does this affect the width of confidence intervals?

  4. Suppose X1,…,XnX_1,\dots,X_n have a heavy-tailed distribution (e.g., Cauchy). Investigate the sampling distribution of X‾\bar{X} for increasing nn. Does the CLT apply? What happens to the sample median?

References