Statistics for experimental data

Linear Regression Calculator

Fit a simple least-squares line to paired measurements and interpret its statistics. Research Mode provides regression diagnostics and inferential information, useful for laboratory calibration, trends and student research.

Open Regression Calculator

What you can do

  • Enter corresponding x and y data samples.
  • Estimate intercept a and slope b for the model y = a + bx.
  • Examine goodness of fit with R² and residual information.
  • Review slope inference, confidence intervals and statistical assumptions.

Formula and interpretation

Least squares chooses a and b to minimize the sum of squared vertical residuals yᵢ − (a + bxᵢ). R² describes the fraction of sample y-variation explained by the fitted line under this model. A high R² alone does not establish causation, correct calibration or valid extrapolation.

Worked regression example

For x = [1,2,3,4,5] and y = [3,5,7,9,11], all points follow y = 1 + 2x. Therefore the intercept is 1, slope is 2 and R² = 1. This deliberately simple case makes it easy to verify input order and the solver's fit before analysing noisy observations.

How to use the workspace

  1. Open Research Mode and find Linear Regression Diagnostics.
  2. Enter 1,2,3,4,5 as x data and 3,5,7,9,11 as y data.
  3. Choose a valid significance level and run the calculation.
  4. Check units of the slope, residual pattern, R² and confidence interval before drawing conclusions.

Assumptions and common errors

  • Paired order: each x value must match its corresponding y observation.
  • Assumptions: ordinary least-squares inference depends on appropriate error and model assumptions.
  • Extrapolation: predictions outside the observed x range can be unreliable even with an excellent R².

Frequently asked questions

What is the difference between slope and R²?
Slope describes the estimated y change per unit x; R² summarizes fit to observed sample variation.
Can I enter unevenly spaced x values?
Yes. X values need not be equally spaced, but there must be enough distinct values to estimate a slope.
Does correlation imply causation?
No. Regression association alone does not demonstrate a causal relationship.

Related calculators and guides