Confidence Interval

A confidence interval is a range for the true value you're trying to estimate — your best guess, plus or minus a margin. The catch is what "95% confident" does and doesn't mean: it describes the procedure, not the single interval in front of you.

What it is

A sample gives you a single number — a sample mean, a difference between two groups, a regression slope. That number is your best estimate of an unknown population parameter, but it's almost certainly a little off, because a different sample would have given a slightly different value. A confidence interval wraps that point estimate in a range wide enough to express how much it could plausibly be off by.

So instead of reporting "the mean is 50," you report "the mean is 50, with a 95% confidence interval of 47 to 53." The width is the honest part: it says the data pin the true value down to roughly a six-unit window, no tighter.

The formula

Every confidence interval has the same shape — a point estimate, plus or minus a margin built from a critical value and a standard error:

interval = estimate ± (critical value) × (standard error)

For the mean of a single sample, the estimate is the sample mean , the standard error is s/√n, and the critical value is the Student-t multiplier t*:

x̄ ± t* · ( s / √n )

Here t* is the Student-t critical value for your chosen confidence level and n − 1 degrees of freedom; s is the sample standard deviation and n the count. The 95% level is the common default. Two levers set the width: the interval shrinks as n grows (more data, more precision) and as s falls (less spread, more precision).

How to read it

What you seeWhat it means
A wider intervalMore uncertainty — the data pin the value down loosely
A narrower intervalMore precision, usually from a larger sample or tighter data
A CI for a difference that excludes 0Consistent with significance at the matching level
A CI for a difference that includes 0Zero remains plausible — the difference may be nothing

The crucial subtlety is what the percentage attaches to. A 95% confidence interval means: if you repeated the whole sampling-and-computing procedure many times, about 95% of the intervals it produces would contain the true parameter. It is not a 95% probability that this interval contains it. The true value is a fixed (unknown) number, and your one interval either covers it or doesn't — the 95% is a property of the method, not of the single result.

A worked example. You measure 25 parts and get a mean diameter of = 50.0 mm with a standard deviation of s = 5.0 mm. The standard error is 5.0/√25 = 1.0 mm. For 95% confidence and 24 degrees of freedom, t* ≈ 2.06, so the margin is 2.06 × 1.0 ≈ 2.06 mm. The interval is 50.0 ± 2.06, or about 47.9 to 52.1 mm. Reading: this procedure brackets the true mean diameter 95% of the time, and on this sample it lands between roughly 48 and 52. Quadruple the sample to 100 and the standard error halves to 0.5, shrinking the interval to about 49 to 51 — same data spread, twice the precision.

What a confidence interval is not

  • Not a probability about this interval. "95%" describes the long-run hit rate of the procedure, not the chance that your one interval is right.
  • Not the range of the data. It's a range for a parameter (like a mean), and it's far narrower than the spread of individual values.
  • Not a guarantee. If the test's assumptions fail — biased sampling, the wrong distribution — the stated coverage no longer holds.
  • Not a yes/no verdict. Whether it excludes a value is informative, but the width carries just as much of the story.
How Stratum computes it. Stratum reports confidence intervals for means, for mean differences in its two-sample comparison, and for regression coefficients, and it draws confidence and prediction bands directly on regression plots. The critical values, degrees of freedom, and handling of missing values follow the rules on the conventions page, so a Stratum interval reconciles against any standard package.

See also

Related terms
P-Value · Effect Size · Standard Deviation
Try it free
Sample-size calculator — see how n drives the width of an interval
On the blog
How to run a t-test
In the app
Run a two-sample comparison and read the interval for the difference

A point estimate tells you what the data say; a confidence interval tells you how far to trust it. Pair it with a p-value and an effect size and you've reported not just whether there's an effect, but how big it is and how precisely you've measured it.