Unit 5, lesson 36

Sample Means and Sampling Distributions

What a random sample of independent and identically distributed observations is, how a statistic such as the sample mean has its own sampling distribution, and how the standard error of the sample mean depends on the sample size.

  • Video 36
  • Sums and Sample Means

One measurement varies from trial to trial, and so does an average of several measurements, because a new sample can give a new average. Before the data arrive, the average is a random variable with its own probability distribution, and one observed average is only a single value from it. This lesson builds that distribution exactly for small discrete models, keeps the observations, the sample, the statistic and its observed value apart, and shows how the spread of the average depends on the sample size and on independence.

Key terms

Independent and identically distributed

Definition Random variables X1,…,XnX_1, \dots, X_n are independent and identically distributed, abbreviated IID, if they are mutually independent and all have the same distribution. For discrete variables that share the PMF pXp_X of a variable XX, this means

P(X1=x1,…,Xn=xn)=∏i=1npX(xi)\begin{aligned} &P(X_1 = x_1, \dots, X_n = x_n) \\[0.4em] &\quad = \prod_{i=1}^{n} p_X(x_i) \end{aligned}

for all values x1,…,xnx_1, \dots, x_n. Having the same distribution does not make variables independent, and independent variables need not have the same distribution.

In plain words Every observation follows the same probability law, and learning the values of some observations does not change the probabilities for the others. IID is a property of the model for how the data arise, not a description of numbers that happen to look alike.

Example In a constructed model, each measurement equals 00 or 44 with probability 12\tfrac12 each, so one measurement has mean μ=2\mu = 2 and variance σ2=4\sigma^2 = 4. For two IID measurements, each of the ordered pairs (0,0)(0, 0), (0,4)(0, 4), (4,0)(4, 0) and (4,4)(4, 4) has probability 12⋅12=14\tfrac12 \cdot \tfrac12 = \tfrac14. If instead the second measurement is a copy of the first, so that X2=X1X_2 = X_1, the two still have the same distribution, but they are dependent, since P(X1=0,X2=4)=0P(X_1 = 0, X_2 = 4) = 0 while P(X1=0) P(X2=4)=14P(X_1 = 0)\,P(X_2 = 4) = \tfrac14.

Random sample

Definition In this course, a random sample of size nn from a distribution is an ordered list X1,…,XnX_1, \dots, X_n of IID random variables, each with that distribution. Before observation the XiX_i are random. After observation they have particular values, written x1,…,xnx_1, \dots, x_n, which form one realization of the sample. The order is part of the outcome, so the samples (0,4)(0, 4) and (4,0)(4, 0) are different outcomes.

In plain words A random sample describes, with probabilities, a plan for collecting data before it is carried out. The numbers recorded afterward are one result of that plan, and running the plan again could give different numbers.

Example Two measurements from the 00 or 44 model form a random sample (X1,X2)(X_1, X_2) with four equally likely outcomes, and a run that records x1=4x_1 = 4 and x2=0x_2 = 0 is one realization. By contrast, draw two tickets without replacement from a box holding one ticket marked 00 and one marked 44. Each draw on its own is 00 or 44 with probability 12\tfrac12, but the second draw is always the ticket left over. The draws are identically distributed and dependent, so they do not form a random sample in this sense.

Statistic

Definition A statistic is a random variable T=g(X1,…,Xn)T = g(X_1, \dots, X_n) computed from the sample by a fixed rule gg that depends on the sample values alone. Before sampling, TT is random. After the sample is observed, the number t=g(x1,…,xn)t = g(x_1, \dots, x_n) is the observed value of the statistic.

In plain words A statistic is a recipe, fixed in advance, for turning data into a number. Because the data are random, the result of the recipe is a random variable too. A single observed value of a statistic is one number, not its whole distribution.

Example For a sample (X1,X2)(X_1, X_2) from the 00 or 44 model, the sample maximum max⁡(X1,X2)\max(X_1, X_2), the number of observations equal to 44 and the average 12(X1+X2)\tfrac12(X_1 + X_2) are all statistics. For the realization (4,0)(4, 0) their observed values are 44, 11 and 22. Before sampling, the maximum equals 44 with probability 34\tfrac34, because only the pair (0,0)(0, 0) gives a maximum of 00.

Sample mean

Definition For a sample X1,…,XnX_1, \dots, X_n of fixed size n≥1n \ge 1, the sample mean is the statistic

Xˉ=X1+X2+⋯+Xnn.\bar{X} = \frac{X_1 + X_2 + \cdots + X_n}{n}.

If every XiX_i has the same finite mean μ\mu, linearity of expectation gives

E[Xˉ]=1n∑i=1nE[Xi]=nμn=μ.\begin{aligned} E[\bar{X}] &= \frac{1}{n} \sum_{i=1}^{n} E[X_i] \\[0.4em] &= \frac{n\mu}{n} = \mu . \end{aligned}

This step uses only the common mean, not independence.

In plain words The sample mean is the ordinary average of the observations, but before they are observed it is a new random variable. Its possible values can differ from the possible values of a single observation, and when all observations share the same finite mean, its expected value equals that mean.

Example For two IID measurements from the 00 or 44 model, the four equally likely pairs have averages 00, 22, 22 and 44. So Xˉ=2\bar{X} = 2 with probability 12\tfrac12, even though a single measurement never equals 22. Its expected value is 0⋅14+2⋅12+4⋅14=20 \cdot \tfrac14 + 2 \cdot \tfrac12 + 4 \cdot \tfrac14 = 2, which is μ\mu.

Sampling distribution

Definition The sampling distribution of a statistic TT is the probability distribution of TT determined by the model for the sample. For a discrete sample, P(T=t)P(T = t) is the total probability of all ordered outcomes (x1,…,xn)(x_1, \dots, x_n) with g(x1,…,xn)=tg(x_1, \dots, x_n) = t. It follows exactly from the model. A histogram of simulated or recorded values of TT only approximates it and carries sampling error.

In plain words The sampling distribution assigns probabilities to the values the statistic could take if the whole sampling plan were carried out again. It can be computed from the model without collecting any data.

Example For two observations from the 00 or 44 model, the sampling distribution of Xˉ\bar{X} puts probabilities 14\tfrac14, 12\tfrac12 and 14\tfrac14 on the values 00, 22 and 44. For four IID observations there are 1616 equally likely ordered records. The number of 44s in a record is 00, 11, 22, 33 or 44 in 11, 44, 66, 44 and 11 of them, and the sample mean equals that number, since the sum is 44 times it.

xˉ\bar{x}0011223344
P(Xˉ=xˉ)P(\bar{X} = \bar{x})116\tfrac{1}{16}416\tfrac{4}{16}616\tfrac{6}{16}416\tfrac{4}{16}116\tfrac{1}{16}

The center is still 22. The probability that Xˉ\bar{X} lies within 11 of the center has grown from 12\tfrac12 for two observations to 1416\tfrac{14}{16}, although P(Xˉ=2)P(\bar{X} = 2) itself fell from 12\tfrac12 to 616\tfrac{6}{16}. The distribution is still discrete, with five possible values, and it is not a normal distribution.

Standard error

Definition The standard error of a statistic is the standard deviation of its sampling distribution. Let X1,…,XnX_1, \dots, X_n be independent, each with mean μ\mu and finite variance σ2\sigma^2, and let Sn=X1+⋯+XnS_n = X_1 + \cdots + X_n. Independence makes the variances add, so Var⁡(Sn)=nσ2\operatorname{Var}(S_n) = n\sigma^2, and

Var⁡(Xˉ)=1n2Var⁡(Sn)=nσ2n2=σ2n.\begin{aligned} \operatorname{Var}(\bar{X}) &= \tfrac{1}{n^2} \operatorname{Var}(S_n) \\[0.4em] &= \frac{n\sigma^2}{n^2} = \frac{\sigma^2}{n} . \end{aligned}

The standard error of the sample mean is therefore

SD⁡(Xˉ)=σn.\operatorname{SD}(\bar{X}) = \frac{\sigma}{\sqrt{n}} .

Here σ\sigma comes from a fully specified model. When σ\sigma is unknown and estimated from data, the result is only an estimate of the standard error.

In plain words The standard deviation σ\sigma describes how single observations vary, and the standard error describes how averages of nn observations vary from sample to sample. When σ>0\sigma > 0, halving the standard error takes four times as many independent observations, because of the square root. A smaller standard error describes the spread of the average across possible samples, and it does not promise that each new observation moves an observed average closer to μ\mu.

Example In the 00 or 44 model σ=2\sigma = 2. The standard error of Xˉ\bar{X} is 2/2=22/\sqrt{2} = \sqrt{2} for n=2n = 2, matching the variance 14⋅4+12⋅0+14⋅4=2\tfrac14 \cdot 4 + \tfrac12 \cdot 0 + \tfrac14 \cdot 4 = 2 of the sampling distribution for two observations. It is 11 for n=4n = 4, matching the variance 4+4+0+4+416=1\tfrac{4 + 4 + 0 + 4 + 4}{16} = 1 from the table, and 12\tfrac12 for n=16n = 16. The derivation of σ2/n\sigma^2/n used independence, and without it the rule can fail. If X2=X1X_2 = X_1, then Xˉ=X1\bar{X} = X_1 and its variance stays 44 instead of dropping to 22. Along a single run, the observations 44 and 00 give the average 22, which equals μ\mu, but a third observation 44 moves the average to 83\tfrac83, farther from μ\mu.

Check yourself

  1. Observations are IID with mean 1010 and standard deviation 66. Find the mean and the standard error of Xˉ\bar{X} for n=9n = 9, and the sample size that gives a standard error of 11.
Show the answer

The mean of Xˉ\bar{X} is 1010 for every sample size. For n=9n = 9 the standard error is 6/9=26/\sqrt{9} = 2. A standard error of 11 needs 6/n=16/\sqrt{n} = 1, so n=6\sqrt{n} = 6 and n=36n = 36, four times the sample size that gave a standard error of 22.

  1. Each observation is independently uniform on {1,3,5}\{1, 3, 5\}, and the sample size is 22. Find the sampling distribution of Xˉ\bar{X}, its mean and variance, and P(Xˉ≥4)P(\bar{X} \ge 4).
Show the answer

The nine ordered pairs are equally likely. The average is 11 for one pair, 22 for the two pairs (1,3)(1, 3) and (3,1)(3, 1), 33 for the three pairs (1,5)(1, 5), (3,3)(3, 3) and (5,1)(5, 1), 44 for two pairs and 55 for one pair. So Xˉ\bar{X} takes the values 11 to 55 with probabilities 19\tfrac19, 29\tfrac29, 39\tfrac39, 29\tfrac29 and 19\tfrac19, and its mean is 33 by symmetry. One observation has mean 33 and variance 4+0+43=83\tfrac{4 + 0 + 4}{3} = \tfrac83, so Var⁡(Xˉ)=8/32=43\operatorname{Var}(\bar{X}) = \tfrac{8/3}{2} = \tfrac43. A direct calculation agrees, since 4⋅1+1⋅2+0⋅3+1⋅2+4⋅19=129=43\tfrac{4 \cdot 1 + 1 \cdot 2 + 0 \cdot 3 + 1 \cdot 2 + 4 \cdot 1}{9} = \tfrac{12}{9} = \tfrac43. Finally, P(Xˉ≥4)=2+19=13P(\bar{X} \ge 4) = \tfrac{2 + 1}{9} = \tfrac13.

  1. Now draw two tickets without replacement from a box holding tickets marked 11, 33 and 55, each draw equally likely among the tickets still in the box. Do the two draws form a random sample? Find the sampling distribution and the variance of their average, and compare with the answer to question 2.
Show the answer

Each draw on its own is uniform on {1,3,5}\{1, 3, 5\}, so the draws are identically distributed. They are dependent, because P(X1=1,X2=1)=0P(X_1 = 1, X_2 = 1) = 0 while P(X1=1) P(X2=1)=19P(X_1 = 1)\,P(X_2 = 1) = \tfrac19. So they are not IID and do not form a random sample in the sense of this course. The six ordered pairs (1,3)(1, 3), (1,5)(1, 5), (3,1)(3, 1), (3,5)(3, 5), (5,1)(5, 1) and (5,3)(5, 3) each have probability 16\tfrac16, with averages 22, 33, 22, 44, 33 and 44. So the average equals 22, 33 or 44 with probability 13\tfrac13 each. Its mean is still 33, since linearity does not need independence, but its variance is 1+0+13=23\tfrac{1 + 0 + 1}{3} = \tfrac23, half the IID value 43\tfrac43. The formula σ2/n\sigma^2/n assumes independence and does not apply here. Dependence lowered the variance in this case, while a copied observation raises it.

How this lesson connects