Confidence Interval on Graph: How to Read & Plot
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
A confidence interval on a graph is a visual range around a point estimate (like a mean or a regression line) that shows the uncertainty of that estimate. You read it as: if the study were repeated many times, the true value would fall inside this range in a certain percentage of repetitions (e.g., 95%). The graph typically shows the estimate as a dot or line, and the interval as error bars, a shaded band, or a pair of boundary lines.
Formula
The margin of error (ME) for a population mean is:
ME = z * (σ / √n)
- z = z-score corresponding to the desired confidence level (e.g., 1.96 for 95%)
- σ = population standard deviation (or sample standard deviation s if the population SD is unknown and n is large)
- n = sample size
The confidence interval is then:
Lower bound = mean − ME | Upper bound = mean + ME
All values are in the same units as the original data.
Worked Example
Using the defaults from the calculator: sample size n = 30, sample mean = 50, sample standard deviation = 10, confidence level = 95%.
- Find the z-score for 95% confidence: z = 1.96
- Compute the standard error: SE = σ / √n = 10 / √30 ≈ 10 / 5.477 = 1.8257
- Multiply by z: ME = 1.96 × 1.8257 ≈ 3.58
- Lower bound = 50 − 3.58 = 46.42
- Upper bound = 50 + 3.58 = 53.58
The 95% confidence interval is [46.42, 53.58]. The calculator shows the same result.
Why Confidence Intervals Appear on Graphs
Graphs with confidence intervals let you see both the best estimate and its reliability at a glance. Without the interval, a single point looks precise even when it is based on a tiny sample. With the interval, you can judge whether differences between groups are likely real or just noise.
Common graph types that show confidence intervals:
- Bar charts with error bars – each bar represents a group mean, and the error bars extend to the upper and lower bounds.
- Line graphs with shaded bands – often used for regression lines or time series; the band widens where data are sparse.
- Forest plots – each row shows an effect size with its confidence interval as a horizontal line.
- Dot plots with whiskers – similar to bar charts but use dots instead of bars.
How to Read a Confidence Interval Graph
First, check the confidence level – usually 95%, but sometimes 90% or 99%. Then look at the center of the interval: that is the point estimate. The width tells you precision: wider = less precise. If two intervals overlap, the difference between the estimates may not be statistically significant, but overlap is not a definitive test. Non-overlap usually indicates a significant difference at roughly the same confidence level.
Pay attention to the scale – if the y-axis starts at a nonzero value, small differences can look dramatic. Also note whether the error bars represent confidence intervals or standard errors (they are different; standard errors are narrower).
How to Choose the Right Confidence Level
The confidence level is a trade-off between precision and certainty. Higher confidence (e.g., 99%) gives a wider interval – you are more sure the true value is inside, but the interval is less informative. Lower confidence (e.g., 90%) gives a narrower interval but a higher chance of missing the true value.
For most exploratory work, 95% is standard. Use 99% when the stakes are high (e.g., medical trials) and 90% when you are screening many possibilities and want to avoid missing a candidate.
Common Mistakes When Plotting Confidence Intervals
- Using the standard deviation instead of the standard error – the interval should be based on the standard error (σ/√n), not the raw SD.
- Confusing confidence intervals with prediction intervals – a prediction interval for a new observation is much wider than the confidence interval for the mean.
- Ignoring the sample size – a small n gives a wide interval, but that is not a flaw; it reflects real uncertainty.
- Assuming overlap means “no difference” – this is a common misinterpretation. Overlap can still hide a significant difference, especially with unequal sample sizes.
- Misreading the confidence level – a 95% CI does not mean that 95% of the data lie inside the interval; it means that 95% of similarly constructed intervals would contain the true mean.
Limitations and Alternatives
Confidence intervals assume random sampling and that the sampling distribution is approximately normal (valid for large n via the Central Limit Theorem). For small samples, use a t-distribution instead of z. For non-normal data, consider bootstrapping to generate intervals.
Alternatives to confidence intervals include:
- Credible intervals – from Bayesian analysis; they have a different interpretation (probability that the parameter lies in the interval given the data).
- Prediction intervals – for future observations, not the mean.
- Standard error bars – simpler but do not directly show confidence.
Frequently Asked Questions
What does a 95% confidence interval mean?
It means that if you repeated the same study many times and calculated a 95% confidence interval each time, about 95% of those intervals would contain the true population parameter. It does not mean there is a 95% chance the true value is in this particular interval.
Why are my error bars so wide?
Wide error bars usually mean a small sample size, high variability in the data, or a high confidence level (e.g., 99%). If you increase the sample size, the standard error shrinks, and the interval narrows.
Can I put confidence intervals on any graph?
You can add them to any graph that shows an estimate – means, proportions, regression coefficients, etc. However, they are only meaningful if the estimate has a sampling distribution and you have enough data to approximate it.
What is the difference between a confidence interval and a standard deviation?
The standard deviation describes the spread of the data values themselves. A confidence interval describes the uncertainty in the estimate of the mean (or other parameter). The CI is always narrower than the range of the data because it uses the standard error.
How do I choose between 90%, 95%, and 99%?
Use 95% as a default. Choose 99% when you need high certainty and can tolerate a wider interval. Choose 90% when you are doing preliminary screening and want to avoid missing a potential effect, even at the cost of more false positives.
Related
Formula used
in n | Sample size | - | 30 | 1 in mean | Sample mean | - | 50 | 0 in sd | Sample std dev | - | 10 | 0 in conf | Confidence level (%) | - | 95 | 50 out me | Margin of error | - | (sd / sqrt(n)) * (conf == 90 ? 1.645 : conf == 95 ? 1.96 : conf == 99 ? 2.576 : 1.96) | 2 out lower | Lower bound | - | mean - me | 2 out upper | Upper bound | - | mean + me | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.