Unit 5, lesson 36

Confidence Intervals and Coverage

What a confidence interval is, how its confidence level and coverage probability describe the procedure over repeated samples, and how the margin of error depends on the level, the spread and the sample size.

  • Video 36
  • Confidence Intervals and Sample Size

A random sample of 2525 observations has mean 5252. The sample mean is a sensible estimate of the population mean μ\mu, but the single number does not say how far from μ\mu it might be. A confidence interval attaches a range to the estimate, produced by a rule whose behavior over repeated samples can be worked out in advance. This lesson builds such a rule, explains what its confidence level promises and what it does not, and shows how the width of the interval depends on the level and on the sample size.

Key terms

Confidence interval

Definition Let θ\theta be a parameter of a statistical model. An interval procedure is a rule that turns each possible data set into an interval [L,U][L, U], whose endpoints LL and UU are statistics computed from the data. The procedure gives confidence intervals for θ\theta at confidence level 1−α1 - \alpha if, under the model,

P(L≤θ≤U)=1−αP(L \le \theta \le U) = 1 - \alpha

for every allowed value of θ\theta and of any other parameters in the model, with the probability computed over random samples while the parameters stay fixed. Many practical procedures reach this only approximately, and some guarantee at least 1−α1 - \alpha. The interval computed from the observed data is also called a confidence interval. It is one outcome of the procedure. The simplest example assumes independent observations from N(μ,σ2)N(\mu, \sigma^2) with σ\sigma known, and uses

xˉ±z0.975 σn,\bar{x} \pm z_{0.975} \, \frac{\sigma}{\sqrt{n}} ,

where z0.975≈1.959964z_{0.975} \approx 1.959964 is the 0.9750.975 quantile of the standard normal distribution. This is the 95 percent z interval for μ\mu.

In plain words A confidence interval is an estimate together with a range built by a fixed recipe. Before the data arrive, the endpoints are random, because they depend on which sample is drawn. The parameter is a fixed unknown number. The confidence statement is a statement about the recipe.

Example Take σ=10\sigma = 10 and n=25n = 25, so the standard error is SE⁡=σ/n=10/5=2\operatorname{SE} = \sigma/\sqrt{n} = 10/5 = 2. With the observed mean xˉ=52\bar{x} = 52,

52±1.96⋅2=[48.08, 55.92].\begin{aligned} 52 &\pm 1.96 \cdot 2 \\[0.4em] &= [48.08,\ 55.92] . \end{aligned}

This is the 95 percent confidence interval for μ\mu from this sample. Another sample would give another center and another interval.

Confidence level

Definition The confidence level 1−α1 - \alpha, often written as a percentage, is the coverage probability that an interval procedure is designed to have. It is chosen before the data are seen. For the z interval, level 1−α1 - \alpha uses the critical value z1−α/2z_{1 - \alpha/2}, the number with P(−z1−α/2≤Z≤z1−α/2)=1−αP(-z_{1 - \alpha/2} \le Z \le z_{1 - \alpha/2}) = 1 - \alpha when Z∼N(0,1)Z \sim N(0, 1), and the interval is

xˉ±z1−α/2 σn.\bar{x} \pm z_{1 - \alpha/2} \, \frac{\sigma}{\sqrt{n}} .
Confidence level9090 percent9595 percent9999 percent
Critical value1.64491.64491.96001.96002.57582.5758

In plain words For the z interval with the same data, a higher confidence level means a larger critical value and a wider interval. A normal-based interval with 100 percent confidence would have to be the whole number line, which tells us nothing. The level belongs to the procedure, so it is set in advance and not adjusted after seeing whether the interval includes a value someone hoped for.

Example For xˉ=52\bar{x} = 52 and SE⁡=2\operatorname{SE} = 2, the 90 percent interval is 52±1.6449⋅252 \pm 1.6449 \cdot 2, about [48.71,55.29][48.71, 55.29], and the 99 percent interval is 52±2.5758⋅252 \pm 2.5758 \cdot 2, about [46.85,57.15][46.85, 57.15]. The 95 percent interval [48.08,55.92][48.08, 55.92] lies between them. All three are centered at 5252.

Coverage probability

Definition The coverage probability of an interval procedure at a parameter value θ\theta is the probability, computed under the model with θ\theta and any other parameters fixed, that the random interval [L,U][L, U] contains θ\theta. For the z interval, with z=z1−α/2z = z_{1 - \alpha/2}, the interval contains μ\mu exactly when the standardized sample mean lies between −z-z and zz,

Xˉ−zσn≤μ≤Xˉ+zσn  ⟺  −z≤Xˉ−μσ/n≤z.\begin{aligned} &\bar{X} - z\frac{\sigma}{\sqrt{n}} \le \mu \le \bar{X} + z\frac{\sigma}{\sqrt{n}} \\[0.4em] &\iff -z \le \frac{\bar{X} - \mu}{\sigma/\sqrt{n}} \le z . \end{aligned}

Under independent normal sampling with known σ\sigma the middle quantity has the N(0,1)N(0, 1) distribution, so the coverage is exactly 1−α1 - \alpha for every value of μ\mu. The level a procedure is designed for is its nominal coverage. The actual coverage under the process that really produced the data can differ when the assumptions fail.

In plain words Coverage is a property of the procedure under stated assumptions. If the assumptions are wrong, the advertised level can be wrong too. Replacing σ\sigma by the sample SD ss while keeping the critical value 1.961.96 is one example. Under normal sampling the actual coverage of that shortcut is about 0.9380.938 with n=25n = 25 and about 0.8780.878 with n=5n = 5. A sample of volunteers instead of a random sample can shift every interval away from the target, and the stated coverage does not account for that.

Example Keep σ=10\sigma = 10 and n=25n = 25, suppose a simulation model has μ=50\mu = 50, and look at five hand-picked sample means, 46.546.5, 4848, 5050, 5252 and 53.553.5. A 95 percent interval contains 5050 exactly when its center is within 3.923.92 of 5050, so all five do. A 90 percent interval needs the center within 3.293.29, so the intervals centered at 46.546.5 and 53.553.5 miss. These five means were chosen by hand, so the counts say nothing about coverage. Coverage concerns random samples, and under the model P(∣Xˉ−50∣≤3.92)≈0.95P(\lvert \bar{X} - 50 \rvert \le 3.92) \approx 0.95.

Margin of error

Definition For an interval of the form estimate ± m\pm\, m, the margin of error mm is the half-width, and the full width is 2m2m. For the z interval

m=z1−α/2 σn.m = z_{1 - \alpha/2} \, \frac{\sigma}{\sqrt{n}} .

It grows with the confidence level and with σ\sigma, and it is proportional to 1/n1/\sqrt{n}. It reflects only random sampling variation under the model. It does not include bias from how the data were collected, such as selection of the sample, nonresponse or measurement error.

In plain words To halve the margin at the same confidence level, quadruple the sample size. A larger sample makes the mean more precise, but it does not make individual observations less variable. A very large sample of volunteers can produce a narrow interval around the wrong value.

Example With σ=10\sigma = 10 and n=25n = 25, the standard error is 22 and the 95 percent margin is about 3.923.92, for a full width of about 7.847.84. With n=100n = 100 the standard error is 10/100=110/\sqrt{100} = 1 and the margin is about 1.961.96, half as large. The SD of individual observations is 1010 in both cases.

Repeated-sampling interpretation

Definition Imagine repeating the whole study many times independently with the parameter fixed, each time drawing a new sample and computing an interval by the same rule. The repeated-sampling interpretation says that the long-run proportion of these intervals that contain θ\theta equals the coverage probability, which is 1−α1 - \alpha for an exact procedure whose assumptions hold. Once the data are observed, a computed interval such as [48.08,55.92][48.08, 55.92] either contains the fixed μ\mu or does not, and the 95 percent describes the method that produced it. A probability that μ\mu lies in a particular interval treats μ\mu as uncertain, and it is the kind of statement a Bayesian credible interval makes from a prior and the data.

In plain words Confidence is earned by the method, not by any single interval. It is also about the parameter, not about individual values. In this model individual observations have SD 1010, so even an interval of width 7.847.84 centered exactly at μ=50\mu = 50 would contain only about 30 percent of individual observations. The interval also does not say that every value inside it is equally plausible or that values just outside it are impossible.

Example Run the 95 percent procedure on 100100 independent samples. The number of intervals that contain μ\mu is a binomial random variable with 100100 trials and success probability 0.950.95. Its mean is 9595, yet the chance of exactly 9595 covering intervals is only about 0.180.18, and the chance that all 100100 cover is about 0.0060.006. The level describes the long run, not a guaranteed count in any finite batch.

Check yourself

  1. Independent observations come from a normal population with known σ=8\sigma = 8. A sample of n=16n = 16 has xˉ=30\bar{x} = 30. Find the standard error, the 95 percent margin of error and the 95 percent interval. What happens to the margin if the sample size is 6464 instead?
Show the answer

The standard error is 8/16=28/\sqrt{16} = 2, and the margin is about 1.96⋅2=3.921.96 \cdot 2 = 3.92, so the interval is about [26.08,33.92][26.08, 33.92]. With n=64n = 64 the standard error is 8/8=18/8 = 1 and the margin is about 1.961.96, half as large. The larger sample would also have its own sample mean, so the center would usually move, but the margin halves whatever that mean turns out to be.

  1. The 95 percent interval [48.08,55.92][48.08, 55.92] for a mean comes from 2525 independent normal observations with known σ=10\sigma = 10. From it a report concludes that 95 percent of customers have values between 48.0848.08 and 55.9255.92, and that there is a 95 percent probability that μ\mu lies between those numbers. Correct both statements, then say what happens to the interval if the level is raised to 99 percent with the same data.
Show the answer

The interval estimates the population mean, not the spread of individual customers. In this model individual values are normal with SD 1010, so at most about 30 percent of them fall in any range this narrow. The 95 percent describes the procedure, which covers the fixed μ\mu in 95 percent of repeated samples under its assumptions. This particular interval either contains μ\mu or does not, and a probability statement about μ\mu would need a Bayesian analysis with a prior. Raising the level to 99 percent raises the critical value from about 1.961.96 to about 2.582.58, so the interval widens to about [46.85,57.15][46.85, 57.15] around the same center.

  1. An analyst plans a 95 percent interval to compare μ\mu with a benchmark of 48.548.5. The 95 percent interval [48.08,55.92][48.08, 55.92] includes 48.548.5, so the analyst reports the 90 percent interval [48.71,55.29][48.71, 55.29] instead, which excludes it. The rule in use is to report the 90 percent interval when it excludes 48.548.5 and the 95 percent interval otherwise. If in fact μ=48.5\mu = 48.5, what is the coverage of this rule?
Show the answer

When the 90 percent interval contains 48.548.5, the rule reports the 95 percent interval, which is wider around the same center and also contains it. When the 90 percent interval excludes 48.548.5, the rule reports that interval, which misses. So the rule covers μ=48.5\mu = 48.5 exactly when the 90 percent interval does, and its coverage there is 0.900.90, not the advertised 0.950.95. Choosing the level after seeing the data changes the procedure, and the stated confidence no longer describes it.

How this lesson connects