Confidence interval

A confidence interval is a range of values that describes the uncertainty inherent in forming an estimate of a population parameter based on a random sample of said population. It is a range of likely values of a given population parameter based on a selected confidence level. For example, a confidence level of 95% indicates that, given that the same procedure and constraints are used to generate the confidence interval, 95% of the computed confidence intervals will contain the population parameter. Thus, the confidence interval does not reflect the variability of the population parameter. Rather, it provides a range of values that are likely to include the population parameter based on the random error of the sample.

Confidence level

A confidence level provides the proportion of confidence intervals that contain the true population parameter. A confidence level is selected prior to examining the data. The most commonly used confidence level is 95%, though 90% and 99% are also used.

Based on the central limit theorem, the sampling distribution of sample means for a given population is normally distributed for large samples (typically n>30). Furthermore, the empirical rule states that for a normally distributed random variable, 95% of the values lie within 2 standard deviations of the mean. Thus, given a normally distributed random variable with sample mean, x, a confidence interval of x ± 2σx will contain the population mean, μ, if x falls within two standard deviations of the true population mean. This is depicted in the figure below.



The confidence interval computed using the sample mean, x1, and a confidence level of 95% is shown in the figure. This confidence level means that any confidence interval computed using the same constraints will contain the population mean, μ, 95% of the time. Only values of the sample mean that lie outside of the area shaded in green will fail to include the true population parameter, and this will occur 5% of the time.

Generally, a higher confidence level results in a wider, but less precise confidence interval. The example above applies to a confidence level of 95%. The computation of a confidence interval is dependent on the confidence level, which determines the margin of error.

Computing a confidence interval

A confidence interval is computed by adding and subtracting the margin of error (MOE) to the test statistic. For a sample mean, x, the confidence interval (CI) can be expressed as

CI = x ± MOE

where the computation of the margin of error is dependent on whether the population standard deviation is known. If it is not known, it can be estimated using the sample standard deviation. For a normally distributed random variable with known standard deviation, the margin of error is computed using the formula

where z* is the critical value of the Z distribution for the given confidence level, σ is the standard deviation, and n is the sample size. If the standard deviation is estimated using a sample standard deviation, a Student's t distribution is used instead of a Z distribution, and the margin of error is computed using the formula

where t* is the critical value of the Student's t distribution, s is the sample standard deviation, and n is the sample size.

Example

A survey of of 100 U.S. adults finds that they watch an average of 15 hours of TV per week. Given that the population standard deviation is known to be 2 hours, compute a confidence interval for the average number of hours of TV watched at a 95% confidence level.

Since the sample size is larger than 30, we can assume that the data is normally distributed and compute z* since the population standard deviation (σ = 2) is known. The critical value, z*, is dependent on the selected confidence level and whether a one-sided or two-sided confidence level is appropriate. Since we are concerned with deviations on either side of the mean, rather than on only one side, a two-sided confidence interval is appropriate in this case. z* can be determined using a Z table by finding the Z-score of the value on either side of the Z distribution that corresponds to a probability of α/2, where α, the significance level, is computed by subtracting the confidence level from 1:

α = 1 - 0.95 = 0.05

Thus, z* is the Z-score on either side of the Z distribution corresponding to a probability of 0.025, or:

z* = 1.96

Refer to the Z table page for more information on using Z tables. The margin of error can then be computed as

and the confidence interval given a sample mean of 15 is:

Based on this confidence interval, we may infer that U.S. adults watch an average of between 14.61 and 15.39 hours of TV per week.

Confidence intervals are also commonly depicted graphically. For example, the figure below depicts the confidence interval 6 ± 3:



The sample mean is represented by a dot on the graph, and the margin of error is represented by line segments extending above and below the sample mean. Note that graphs of confidence intervals may also take on a horizontal form, rather than a vertical one.

Typically, the confidence intervals of multiple random samples are graphed, each of which may or may not include the population mean, which is represented by a dotted line; the multiple random samples are dispersed across this line. In the figure below, the population mean is μ = 7.5, and 5 confidence intervals are shown, 4 of which include the population mean.



Common misunderstandings

There are a number of common misunderstandings surrounding confidence intervals, typically concerning the probability represented by the confidence level. Since confidence intervals are so widely used and discussed in statistics, it can be helpful to be aware of these misunderstandings.