Unit 5, lesson 37

Confidence Intervals for a Mean

How to build a one-sample t interval for a population mean when the population SD is unknown, how t critical values work, what the normal sampling model assumes and how departures from normality affect coverage.

  • Video 37
  • Confidence Intervals and Sample Size

A delivery service wants to estimate the mean delivery time of its orders. A random sample of 2525 deliveries has mean 2424 minutes and standard deviation 55 minutes, and the population standard deviation is unknown. Putting ss into the known-σ\sigma interval in place of σ\sigma would treat an estimate as if it were exact, and the interval would come out too narrow. This lesson builds the one-sample t interval, which accounts for estimating the spread, and explains when its stated confidence level can be trusted.

Key terms

Normal sampling model

Definition The normal sampling model for one mean says that the observations X1,…,XnX_1, \dots, X_n are independent and identically distributed N(μ,σ2)N(\mu, \sigma^2), with μ\mu and σ>0\sigma > 0 both unknown. Under this model the sample mean has the distribution Xˉ∼N(μ,σ2/n)\bar{X} \sim N(\mu, \sigma^2/n). For n≥2n \ge 2, write SS for the sample SD with the n−1n - 1 denominator, viewed as a random quantity. Then the standardized mean with an estimated standard error has the t distribution with n−1n - 1 degrees of freedom,

T=Xˉ−μS/n∼tn−1,T = \frac{\bar{X} - \mu}{S/\sqrt{n}} \sim t_{n-1} ,

for every value of μ\mu and σ\sigma.

In plain words The model has two parts, independent observations and a single normal population that all of them come from. Independence usually comes from the design, for example a random sample from a large population. Neither part can be proved from the mean and the SD of the data. The denominator S/nS/\sqrt{n} changes from sample to sample, which adds uncertainty beyond the case of a known σ\sigma, and the t distribution accounts for exactly that extra uncertainty when the model holds.

Example Model the 2525 delivery times as independent draws from a normal population. The estimated standard error is

SE⁡^=sn=525=1 min.\widehat{\operatorname{SE}} = \frac{s}{\sqrt{n}} = \frac{5}{\sqrt{25}} = 1 \ \text{min} .

The SD of 55 minutes describes how individual deliveries vary. The standard error of 11 minute describes how the sample mean would vary from one random sample of 2525 to another. The degrees of freedom are n−1=24n - 1 = 24.

t critical value

Definition For a confidence level 1−α1 - \alpha and ν\nu degrees of freedom, the t critical value t1−α/2,νt_{1 - \alpha/2, \nu} is the 1−α/21 - \alpha/2 quantile of the t distribution with ν\nu degrees of freedom. If T∼tνT \sim t_{\nu}, then P(−t1−α/2,ν≤T≤t1−α/2,ν)=1−αP(-t_{1 - \alpha/2, \nu} \le T \le t_{1 - \alpha/2, \nu}) = 1 - \alpha. At a fixed level the t critical value is larger than the normal critical value z1−α/2z_{1 - \alpha/2} and decreases toward it as ν\nu grows.

Degrees of freedom8824249999
t0.975,νt_{0.975, \nu}2.30602.30602.06392.06391.98421.9842

For comparison, z0.975≈1.9600z_{0.975} \approx 1.9600.

In plain words The t distribution has heavier tails than the standard normal, because the estimated SD in the denominator is sometimes too small by chance and then TT lands far out. To keep the same central probability, the cutoff moves farther out. Using 1.961.96 with an estimated SD ignores this. Under the normal sampling model the actual coverage of that shortcut is about 0.9140.914 with n=9n = 9 and about 0.9380.938 with n=25n = 25, not 0.950.95.

Example A 95 percent interval with n=25n = 25 needs t0.975,24≈2.0639t_{0.975, 24} \approx 2.0639, about 5 percent larger than 1.961.96. A 90 percent interval with the same sample size needs t0.95,24≈1.7109t_{0.95, 24} \approx 1.7109, which leaves 5 percent in each tail.

One-sample t interval

Definition Under the normal sampling model with n≥2n \ge 2, the one-sample t interval for μ\mu at confidence level 1−α1 - \alpha is

xˉ±t1−α/2, n−1 sn.\bar{x} \pm t_{1 - \alpha/2,\, n-1} \, \frac{s}{\sqrt{n}} .

The interval contains μ\mu exactly when −t1−α/2,n−1≤T≤t1−α/2,n−1-t_{1 - \alpha/2, n-1} \le T \le t_{1 - \alpha/2, n-1}, so its coverage is exactly 1−α1 - \alpha for every μ\mu and every σ\sigma. The margin of error is t1−α/2,n−1 s/nt_{1 - \alpha/2, n-1} \, s/\sqrt{n}. When the observations are independent but the population is not normal, the coverage is generally not exactly 1−α1 - \alpha, and how close it comes depends on the population and the sample size.

In plain words The sample mean sets the center, the estimated standard error sets the scale, and the critical value brings in the confidence level and the reference distribution. A complete report names the population mean being estimated, the units, the level, the interval and how the data were collected. The interval is about the population mean, not about individual deliveries, and its confidence level describes the procedure over repeated samples rather than a probability for this one interval.

Example For the deliveries, the 95 percent interval is

24±2.0639⋅1≈[21.94, 26.06] min.\begin{aligned} 24 &\pm 2.0639 \cdot 1 \\[0.4em] &\approx [21.94,\ 26.06] \ \text{min} . \end{aligned}

With the same data, the 90 percent interval is 24±1.710924 \pm 1.7109, about [22.29,25.71][22.29, 25.71] minutes. It is narrower only because it accepts a lower coverage. The data and their spread have not changed.

Departures from normality

Definition A departure from normality is any way the population distribution differs from a normal one, such as skewness, heavy tails, outliers, gaps or several peaks. If the observations are independent and identically distributed with finite positive variance but not normal, the coverage of the t interval is generally not exactly 1−α1 - \alpha. By the central limit theorem, and because ss is close to σ\sigma with high probability in large samples, its coverage approaches 1−α1 - \alpha as nn grows, but how large nn must be depends on the population, and no single sample size is enough for every population. Strong skewness, heavy tails, extreme outliers and very small samples call for the most care. Dependence between observations is a separate failure of the model, and it can make s/ns/\sqrt{n} the wrong standard error at any sample size.

In plain words The question is how far the actual coverage is from the stated level when the data are not normal. To judge it, look at the study design and at a plot of the observations, not only at the p-value of a normality test. Check units, recording errors, time order and clusters of related observations. An unusual but genuine value should not be deleted just because it widens the interval. If the conditions fail, change the design, the model or the method, and keep the target parameter clear.

Example Simulations with a million samples each give the following picture. For a strongly right-skewed exponential population, the 95 percent t interval covers μ\mu about 90 percent of the time with n=10n = 10 and about 93 percent of the time with n=40n = 40, while for a normal population it covers 95 percent of the time at both sizes. The misses are lopsided. With n=10n = 10, about 9.5 percent of the intervals lie entirely below μ\mu and only about 0.4 percent lie entirely above it. In a separate simulation of 200,000200{,}000 samples of n=25n = 25 normal observations, each correlated 0.50.5 with the one before it in a stationary autoregressive model, the 95 percent t interval covered μ\mu only about 74 percent of the time.

Check yourself

  1. A random sample of 99 independent observations from a normal population has mean 1010 units and SD 33 units. Build the 95 percent t interval for μ\mu, using t0.975,8≈2.306t_{0.975, 8} \approx 2.306. Why would the critical value 1.961.96 be wrong here?
Show the answer

The estimated standard error is 3/9=13/\sqrt{9} = 1 unit and the degrees of freedom are 88. The interval is 10±2.306⋅110 \pm 2.306 \cdot 1, about [7.694,12.306][7.694, 12.306] units. The value 1.961.96 would give the narrower interval [8.04,11.96][8.04, 11.96], as if the SD were known. Because ss is only an estimate, that shortcut covers μ\mu only about 91 percent of the time under this model instead of 95 percent.

  1. A second random sample of 100100 deliveries has mean 2424 minutes and SD 55 minutes. Build the 95 percent t interval, using t0.975,99≈1.9842t_{0.975, 99} \approx 1.9842. A manager reads the result as saying that 95 percent of deliveries take between 2323 and 2525 minutes. Correct the reading.
Show the answer

The estimated standard error is 5/100=0.55/\sqrt{100} = 0.5 minutes, so the margin is 1.9842⋅0.5≈0.991.9842 \cdot 0.5 \approx 0.99 minutes and the interval is about [23.01,24.99][23.01, 24.99] minutes. It estimates the mean delivery time of all orders, not the range of individual deliveries. Individual times vary with an SD of about 55 minutes. If delivery times were normal with mean 2424 minutes and SD 55 minutes, only about 16 percent of deliveries would take between 2323 and 2525 minutes. The 95 percent describes how often the procedure captures the population mean over repeated random samples.

  1. A manager records 1212 consecutive deliveries by one driver on one rainy evening. Eleven times lie between 2020 and 3535 minutes and one is 9595 minutes, and the driver confirms the long delivery really happened. The manager wants a 95 percent t interval for the mean delivery time of all the company’s orders. Do the data and the design support such an interval?
Show the answer

No. The sample is not a random sample of the company’s orders. One driver on one rainy evening may differ systematically from other drivers and days, and no margin of error corrects that. Consecutive deliveries on the same evening share traffic and weather, so they are probably dependent, and then s/ns/\sqrt{n} can understate the real uncertainty. With only 1212 observations and one extreme value, the normal model is doubtful and the interval is sensitive to that single point. The 9595-minute delivery is genuine, so deleting it to tidy the interval would be wrong. A defensible estimate needs a random sample of deliveries across drivers and days, a plot of the data, and a method suited to the shape and dependence the data show.

How this lesson connects