Statistics & data

Error Bar Graph & Maximum Minimum Gradient Calculator

Paste measurements with absolute uncertainties. Compare the ordinary least-squares line with the full range of lines that intersect every uncertainty rectangle.

Your measurements

Start with the example, or enter your own values. Use a dot for decimals and e for scientific notation.

Error Bar Graph & Maximum Minimum Gradient Calculator inputs
Four numerical columns per row; up to 80 rows. Use 0 for negligible x uncertainty. Two columns are also accepted and mean zero uncertainty.

Calculated locally. No account or uploads.

Result & working

Example

The calculator is loading. You can read the worked example below.

The formula

y = mx + c

|yᵢ − (mxᵢ + c)| ≤ Δyᵢ + |m|Δxᵢ

Δm = (m_max − m_min)/2; Δc = (c_max − c_min)/2

What the variables mean
SymbolMeaning
Δx, ΔyAbsolute measurement uncertainty; each bar extends this far on either side.
m, cGradient and vertical intercept.
BoundsExtrema over all straight lines intersecting every rectangular uncertainty region.

When to use this calculator

Use this to practise drawing acceptable lines and checking every uncertainty bar. With x uncertainty, a line may intersect the rectangle away from its centre. This tool uses rectangular bounds, not a probability ellipse.

Maximum/minimum gradients are found by intersecting linear constraints separately for positive and negative slopes. Intercept bounds are optimized separately: the lines with extreme slope do not necessarily have extreme intercept. The midpoint and half-range summarize bounds; an off-centre best fit is better reported with asymmetric limits.

No acceptable line means these bars and a straight-line model are mutually inconsistent under this criterion. Do not automatically delete points or enlarge bars. If horizontal bars overlap too much, slope bounds can be unbounded; the tool reports this explicitly.

Worked example

The calculator opens with these example values. All steps below are available even with JavaScript disabled.

  1. Fit the central values with ordinary least squares: Sxy/Sxx = 9.9/5 = 1.98.
  2. c = ȳ − mx̄ = 5.05 − (1.98) × 2.5 = 0.1.
  3. For every point require |y − (mx+c)| ≤ Δy + |m|Δx. Solve all constraints together, considering positive and negative gradients separately.
  4. All-rectangle gradient bounds: 1.809211 to 2.128378. Δm = (2.128378 − (1.809211))/2 = 0.1595839.
  5. Optimize intercept separately over all feasible lines: c_min = -0.2709459, c_max = 0.5269737; Δc = 0.3989598.
  6. Half-range relative to the magnitude of the OLS gradient: 0.1595839 / |1.98| × 100 = 8.059794%. This does not imply that the OLS line is acceptable.

Y = 1.98 X + 0.1

Common mistakes

  • Uncertainty bars are not automatically standard deviations. State their meaning.
  • A least-squares line need not intersect every bar.
  • Do not force a fit through the origin without a physical reason.
  • Automatic bounds help you check a graph; practise constructing the lines by eye for assessment.