Confidence intervals, standard error and error bars: reading the spread in lab results
What a confidence interval is, how standard error differs from standard deviation, how to work out a 95% interval, and how to read error bars on a graph.
By Zachery Casey · Published · Reviewed · Editorial policy
A confidence interval is a range, worked out from repeat measurements, that is likely to contain the true mean; a 95% confidence interval is the mean ± t × the standard error. When a lab measures something more than once, the results never agree exactly. A single figure, such as an average purity of 99.0%, hides that spread. Three tools put it back: the standard deviation, the standard error and the confidence interval. Error bars on a graph show one of them. This guide explains what each one means, how they differ, and how to read them without being misled.
It follows on from accuracy, precision and significant figures, which covers standard deviation and relative standard deviation. Terms are defined in the glossary.
Standard deviation: the spread of the results
The standard deviation (SD) describes how far individual results typically sit from their average. It answers the question: if I measure this again, how far off might one result be?
Take five repeat HPLC injections of the same sample, the example from the accuracy guide:
98.9%, 99.1%, 99.0%, 99.2%, 98.8%
The mean is 99.0% and the standard deviation is about 0.16 percentage points. Taking more measurements doesn't make the SD smaller. It gives a better estimate of the method's natural spread, which stays about the same.
How to calculate standard error
The standard error (SE, or standard error of the mean) describes something different: how far the average is likely to be from the true value. Averaging cancels out some of the random scatter, so an average of many results is more reliable than any single one.
SE = SD ÷ √n
where n is the number of measurements. For the five injections:
SE = 0.16 ÷ √5 ≈ 0.07 percentage points.
Standard error vs standard deviation
| Standard deviation | Standard error | |
|---|---|---|
| Describes | The spread of individual results | The uncertainty in the mean |
| With more measurements | Stays about the same | Gets smaller |
| Answers | How variable is the method? | How well do we know the average? |
Because SE is always smaller than SD, it can make data look tidier than it is. That is why it matters which one a report or graph uses.
What is a confidence interval?
A confidence interval gives a range that is likely to contain the true value of the mean. A 95% confidence interval is the one most often quoted.
Working one out
For a small number of measurements, the 95% interval is:
mean ± t × SE
The t-value comes from Student's t-distribution and depends on how many measurements there are. It is larger for small samples, because a handful of results gives a less certain estimate of the spread (NIST/SEMATECH e-Handbook).
| Measurements (n) | t-value for 95% |
|---|---|
| 3 | 4.30 |
| 5 | 2.78 |
| 10 | 2.26 |
| 30 | 2.05 |
| Very many | 1.96 |
For the five injections:
- Mean = 99.0%
- SE ≈ 0.07
- t for n = 5 is 2.78
- 2.78 × 0.07 ≈ 0.20
So the 95% confidence interval is about 99.0 ± 0.2%, or 98.8% to 99.2%.
What "95% confident" means
The wording is easy to misread. It doesn't mean there is a 95% chance the true value lies in this particular range. It means that if the whole procedure were repeated many times, about 95% of the intervals worked out this way would contain the true value.
In practice, a confidence interval is best read as the range of values that are reasonably consistent with the data.
Confidence interval vs measurement uncertainty
A confidence interval from replicate measurements captures random scatter only. It doesn't include systematic errors such as a miscalibrated standard. A lab's stated measurement uncertainty usually combines both, which is why it is often wider. See accuracy, precision and significant figures for how uncertainty is expressed.
Error bars
Error bars are the lines drawn above and below a point or bar on a graph to show spread. They can show any of three things:
| Error bar shows | Width | Use it to judge |
|---|---|---|
| Standard deviation | Stays the same as more measurements are added | How variable individual results are |
| 95% confidence interval | Wider than the SD with six or fewer measurements, narrower with more | Where the true mean probably lies |
| Standard error | Always the narrowest | Rarely useful on its own |
For three measurements, a 95% interval is more than four times as wide as the standard error. The same data can look convincing or doubtful depending on which bar is drawn. A good graph says in its legend which kind of error bar it shows and how many measurements each point is based on (Cumming et al., J. Cell Biol. 2007).
Reading overlapping error bars
Comparing two means by eye is common and often wrong.
- 95% confidence intervals that don't overlap suggest a real difference.
- 95% confidence intervals that overlap slightly can still reflect a real difference. Two means are usually different at about the 5% level even when their intervals overlap by up to a quarter of their length.
- Standard error bars that overlap suggest no clear difference. Standard error bars that are separated by a small gap still may not show one.
These rules of thumb hold only for independent groups with similar numbers of measurements. For a firm answer, a statistical test is needed.
Applying this to lab results
- Replicate injections of one HPLC sample show the instrument's repeatability. A purity reported as one number is usually the mean of a few injections, or a single one.
- Two lots or two labs compared at the second decimal place often differ by less than their combined uncertainty. See accuracy, precision and significant figures.
- Small numbers of repeats give wide intervals. Three measurements can tell you a result is roughly right, but not that it differs from another by a few tenths of a percent.
Replicate HPLC injections like these are in vitro measurements: made in an instrument, under controlled conditions.
When a result is given with an interval or error bar, check what it represents, how many measurements it rests on, and whether it covers random scatter only or the full uncertainty.
Related guides
For how a single purity figure is produced, see HPLC purity explained. For how labs check that an instrument is giving consistent results, see reading a chromatogram. For the quality systems that sit behind a test result, see QA vs QC. For testing whether two results really differ, see p-values and statistical significance. Every lot has its own COA, published on the product page and on that lot's own page. See Quality.
More on research basics
- P-values and statistical significance: comparing two results with a t-testWhat a p-value is and isn't, what statistical significance means, and how a t-test compares two sets of lab results, with a worked HPLC example.
- Looking up a compound: CAS numbers, PubChem and the literatureWhat a CAS number is and how to check one, plus how to identify a research compound with PubChem, UniProt and PubMed, and why salts get their own entries.
- In vitro, in vivo, in silico: what the research terms meanWhat in vitro, in vivo and in silico mean in research, how in vitro and in vivo work differ, and how the terms relate to research-use-only reagents.