Concept · Statistics Library

Confidence interval

A confidence interval is a range of parameter values that are compatible with your data, computed by a procedure that captures the true value in a stated percentage of repeated studies when its assumptions hold.

Chapter 3: Probability and uncertaintyReading 3.5

Understand the idea

A single estimate ('the difference is 1375 g') hides how much it could have wobbled if you had happened to sample different individuals. A confidence interval puts that wobble on the page.

The 95% refers to the METHOD, not to your one interval. If the method's assumptions hold and you repeated the whole study many times and built an interval each time, about 95% of those intervals would contain the true value. Your particular interval either contains it or does not; you never find out which.

Read it as a compatibility range. A 95% CI for a difference of [1260, 1490] says the data are consistent with a difference anywhere in there and are hard to reconcile with a difference of zero. A CI of [-40, 900] says the data cannot distinguish 'no difference' from 'a fairly large one': that is an honest 'we do not know yet', not a finding of no effect.

A confidence interval is one kind of interval estimate: instead of a single best guess, it gives a range of plausible values. The margin of error is the distance from the estimate to either end of a symmetric interval, so an estimate of 52% with a margin of error of 3 points gives the interval 49% to 55%. Error bars on a chart often show confidence intervals, but they can also show a standard deviation or a standard error, so check the caption before reading them as intervals.

Practitioner explanation

A confidence set formed by inverting a matching family of level-alpha tests contains the values not rejected by those tests, subject to matching tails, methods, nuisance treatment and boundary conventions. A different interval and test need not agree.

Coverage is a property of the procedure under its assumptions, and it can fall short of the nominal level: t-intervals on strongly skewed data at small n, Wald intervals for proportions near 0 or 1 (Wilson or Agresti-Coull intervals usually do better), and intervals computed after choosing a model on the same data can all undercover.

With an appropriate independent-sampling design and stable variance, width often scales approximately as 1/sqrt(n); quadrupling n then roughly halves width. Critical values, estimated variability, dependence and design changes can alter that approximation.

When to use it

Consider it when

When reporting an estimate, include an appropriate uncertainty interval where the method supports one. KernelStats output varies by method and data; check the card to see which intervals are available.

Use caution when

As a statement that the true value is 95% likely to be inside YOUR interval (that is a credible interval, which requires a prior), or as a substitute for checking the assumptions the interval's coverage depends on.

Formulas and symbols

t interval for a difference in means

(xˉ1−xˉ2)±tν, 1−α/2⋅SEdiff(\bar{x}_1 - \bar{x}_2) \pm t_{\nu,\,1-\alpha/2} \cdot SE_{\text{diff}}

SE_diff is the standard error of the difference and nu the degrees of freedom used by the test.

Standard error of the difference

SEdiff=s12n1+s22n2SE_{\text{diff}} = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}

Welch form, used by default. The pooled form replaces both variances with the pooled variance.

Common misconceptions

Misconception

There is a 95% probability that the true value lies inside this particular interval.

Correction

The 95% is a long-run property of the procedure. Once computed, your interval either contains the parameter or it does not. A statement of probability about the parameter itself is a Bayesian credible interval and requires a prior.

Misconception

If two groups' confidence intervals overlap, the difference is not significant.

Correction

Not reliable. Overlapping intervals for two separate means can still correspond to a significant difference, because the relevant interval is the one for the DIFFERENCE, which has its own standard error. Test the difference directly.

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.2 Confidence Limits for the Mean, NIST/SEMATECH (2012), §1.3.5.2.
  2. STAT 415: Confidence Intervals, Penn State Eberly College of Science, 6.