Interval plot: confidence intervals and error bars by group

Updated

An interval plot shows, for each group, the mean as a symbol and a vertical bar around it. The bar is usually a 95% confidence interval for the mean, the range of process means that are consistent with the data; sometimes it is one standard error on each side instead. It answers "where is each group's average, and how precisely do we know it?" rather than "how much do individual parts vary?".

When to use it

  • You compare the means of several groups, such as machines, furnaces, suppliers or settings, and want to show the uncertainty of each mean.
  • You report results of a trial to people who need the averages and a sense of how firm they are.
  • You want a graphical companion to a one-way ANOVA or a 2-sample t-test.

How it works

For each group with n values, mean x̄ and standard deviation s:

Standard error: SE = s / √n 95% confidence interval: x̄ ± t(0.975, n − 1) × SE Standard error bar: x̄ ± SE

t(0.975, n − 1) is the 97.5th percentile of Student's t distribution with n − 1 degrees of freedom. It is larger than the normal value of 1.96 for small samples, which widens the interval to account for estimating s from the data: 2.571 for n = 6, 2.262 for n = 10, 2.045 for n = 30.

Two choices change the bars, so a good plot says which it uses:

  • Confidence interval or standard error. A ±1 SE bar is roughly a 68% interval for large samples, and less for small ones (about 64% for n = 6). A 95% confidence interval is wider and easier to interpret.
  • Each group's own s or a pooled s. Using each group's own standard deviation, as in this article, lets a noisy group show a wider bar. A pooled standard deviation (the one ANOVA uses) gives all equal-sized groups the same width and more degrees of freedom, which is fine when the spreads really are similar.

Example

A heat-treat shop runs four furnaces. To check that they deliver the same hardness, a metallurgist hardens 6 test pins in each furnace and measures Rockwell C hardness. The requirement is 57 to 60 HRC.

FurnaceHardness (HRC)
F157.8, 57.5, 58.1, 58.4, 58.8, 58.3
F258.4, 58.3, 58.9, 59.3, 58.7, 58.1
F356.5, 58.1, 57.2, 56.1, 57.0, 56.4
F457.2, 59.4, 57.8, 59.1, 56.9, 58.6

With n = 6, t(0.975, 5) = 2.571. For F3, s = 0.719 and SE = 0.719 / √6 = 0.294, so the interval is 56.88 ± 2.571 × 0.294 = 56.88 ± 0.755. The whole plot, in numbers:

FurnaceMeanStDevSE95% CI for the meanMean ± 1 SE
F158.150.4590.18857.67 to 58.6357.96 to 58.34
F258.620.4400.18058.15 to 59.0858.44 to 58.80
F356.880.7190.29456.13 to 57.6456.59 to 57.18
F458.171.0250.41857.09 to 59.2457.75 to 58.59

Drawn as a graph, each furnace gets a point at its mean and a bar spanning its 95% interval. Three things stand out:

  • F3 is low. Its interval, 56.13 to 57.64, sits below the intervals of F1 and F2 without touching them, and its mean is below the 57 HRC minimum. Three of its six pins are under 57.
  • F4 has the widest bar. Its mean matches F1, but its pins scatter from 56.9 to 59.4, so its mean is known less precisely. That is a consistency problem, different from F3's level problem.
  • SE bars look more decisive. The ±1 SE bars are about 2.6 times shorter than the 95% intervals here, so F3 and F4 seem clearly apart with SE bars even though their 95% intervals overlap.

If the spreads were treated as equal, the pooled standard deviation would be 0.702 with 20 degrees of freedom, and every furnace would get the same half-width: 2.086 × 0.702 / √6 = 0.598 HRC.

How to read the results

  • Read the bars as uncertainty in the mean, not as the spread of parts. Individual pins from F4 range much wider than its interval. For part-to-part spread, look at an individual value plot or a boxplot.
  • Intervals that do not overlap point to a real difference between those means.
  • Intervals that overlap do not prove the means are equal. F3 and F4 overlap from 57.09 to 57.64, yet a 2-sample t-test (Welch) of the two furnaces gives t = 2.51 with 8.96 degrees of freedom and p = 0.033. Test the difference directly.
  • Widths tell you about precision. A wide interval comes from a noisy group, a small sample, or both.

Common mistakes

  • Not saying what the bars are. A ±1 SE bar and a 95% confidence interval differ by a factor of about 2 to 2.6 for small samples. Label the plot.
  • Judging significance by overlap. Use the test, and for many groups use a method that controls the overall error rate, such as Tukey comparisons after ANOVA.
  • Hiding the data. With 6 values per group, show the points as well; a cluster or an outlier changes the story.
  • Using a bar chart with error bars. A bar starting at zero adds ink without information about the mean's uncertainty. Points with intervals are clearer.

Frequently asked questions

What is the difference between error bars and confidence intervals?

"Error bars" is a general term. They may show one standard deviation, one standard error, or a confidence interval. A 95% confidence interval uses the t distribution and is about two standard errors wide on each side for moderate samples.

Why is the interval based on the t distribution?

Because the standard deviation is estimated from the same small sample. The t distribution accounts for that extra uncertainty; for large samples it approaches the normal distribution. See confidence intervals explained.

If two 95% intervals overlap, is the difference not significant?

Not necessarily. Two intervals can overlap by a fair amount and the difference still be significant at the 5% level, as F3 and F4 show. When they do not overlap at all, a test will normally find the difference significant.

Should I use pooled or individual standard deviations?

Use individual standard deviations when the groups may differ in spread, as here. Use a pooled one when a test for equal variances and the plot show similar spreads; it gives narrower, more stable intervals.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab