Definition
A mean bar chart with 95% confidence intervals §11.18 is a figure in which each bar’s height is a sample mean §11.12, here the mean boot duration of one software build over boots, and an error bar §18.1.11 drawn through the top of the bar marks a 95% confidence interval: a range produced by a method that encloses the true mean in 95% of repeated experiments. The half-width is the distance from the mean to either end of the interval. Each interval describes one bar, not the difference between two bars.
Where it fits
Main entry: Standard error (§11.15).
The standard error entry explains the standard error (SE) of a mean: the typical distance between one sample mean and the true mean, measured as the standard deviation §11.14 that the sample mean would show across repeated experiments. The true mean is the mean over all boots that the build could produce under the same conditions. A symmetric interval has half-width . The multiplier is 1.96 under the normal approximation, which treats the sample mean as following the bell-shaped normal distribution; the central limit theorem §15.45 justifies it for a mean of many independent values. For a small sample, the t distribution, which allows for the standard deviation being estimated from the same sample, gives a larger multiplier, about 2.045 for . A reader who knows recovers from each bar.
Write and for the mean boot durations of builds A and B. Their difference is a new estimand §11.2, a new quantity to estimate, and it has its own standard error : where is the covariance §15.44 of the two means: a measure, in squared time units, of how much they rise and fall together across repeated experiments. Boots measured as two separate groups give independent means and a covariance of 0. A paired design §11.7, which matches each boot of A with a boot of B under the same conditions, such as the same board and the same session, usually gives a positive covariance and so a smaller standard error. The figure shows neither the design nor the covariance.
In an invented example, build A boots in a mean of 105 ms (milliseconds) with ms, and build B in a mean of 100 ms with ms. With , the bars show half-widths ms and ms, and the difference is ms.
Independent groups: ms, half-width ms, interval from to 12.07 ms. Zero lies inside it.
Paired, with a covariance of 4 square milliseconds: the correlation, which is the covariance divided by , is , and square milliseconds, so ms, half-width ms, interval from 0.62 to 9.38 ms. Zero lies outside it.
Half-widths added: ms, range from to 14.80 ms, wider than either correct interval.
A correlation always lies between and , so whatever the design, lies between and . With one shared multiplier, the half-width of the difference therefore lies between and , here between 1.96 ms and 9.80 ms. That range is all that the two error bars determine.
All data in this entry’s examples are invented.
Limits and common mistakes
A 95% confidence interval for a mean does not contain 95% of the individual boots. Because , where is the standard deviation of single boots, is times the standard error when .
Overlap of two intervals is not a test. With independent groups and equal standard errors , two 95% intervals stop overlapping only when the means differ by more than . A two-sided hypothesis test §11.22 at the 5% level, which declares a difference when a difference at least as large as the observed one would occur less than 5% of the time if the true means were equal, already declares one once the difference exceeds . Overlapping intervals can therefore hide a difference that the data support.
The multiplier must be known. With small samples, the t multiplier of the difference depends on both sample sizes and on the design, so it can differ from the multiplier of each bar. An interval made by the bootstrap, which resamples the recorded boot durations, can be asymmetric and then has no single half-width.
A bar is an absolute duration. The time that a change adds is the difference between two bars, and only an interval for that difference supports a statement about it. A mean from one figure and a median §11.13 from another, or two durations that start or stop at different events, measure different quantities and cannot be subtracted.
Questions answered
Can you infer a confidence interval for the difference from two half-widths?
Not exactly: two half-widths bound the confidence interval for the difference but do not determine it. The missing quantity is the covariance of the two mean estimates, a measure of how much they vary together, which depends on how the experiment was designed and does not appear in the figure.
A half-width , written and for bars A and B, is a multiplier , such as 1.96, times the standard error of one mean, so each bar gives its standard error as .
If the two bars come from separate, independent groups of runs, the difference has half-width , provided both bars use the same multiplier and each mean can be treated as normally distributed (the normal approximation). Half-widths of 5.88 ms and 3.92 ms give about 7.07 ms.
If the runs are paired, the half-width of the difference depends on the spread of the per-pair differences, which only the raw data §13.16 give. That half-width can be anywhere from to .
Adding the half-widths gives a range that is never narrower than the correct interval under the normal approximation, but usually much wider, so it is not a 95% interval. Subtracting the ends of one interval from the opposite ends of the other gives the same range. The correct route uses the raw measurements: for paired runs, an interval computed from the per-pair differences; for independent groups, the half-width ; or a bootstrap that resamples whole pairs or each group separately.
Related entries: Correlation and covariance (§15.44), Confidence interval (§11.18), Paired design (§11.7), Confidence intervals, whiskers, and uncertainty semantics (§18.1.11).