Free calculatorLive resultsSteps and sourcesEmbed on your site, free

Least Squares Regression Line Calculator

Least Squares Regression Line Calculator works out Fitted equation and Slope (b) from X values (predictor), Y values (response) and Predict y at x =. The default figures on this page give fitted equation of y = 2.2 + 0.6x; change any entry and the result, the working and the sources update together.

Fitted equation
y = 2.2 + 0.6x
Linear Regression Calculator
Slope (b)
0.6
Intercept (a)
2.2
Number of observations
5
Correlation r
0.774597
R squared
0.6
Adjusted R squared
0.466667
Standard error of the estimate
0.894427
Standard error of the slope
0.282843
Standard error of the intercept
0.938083
t statistic for the slope
2.12132
p value for the slope
0.124027
Lower confidence limit for the slope
-0.300132
Upper confidence limit for the slope
1.500132
F statistic for the model
4.5
p value for the model
0.124027
Residual degrees of freedom
3
Total sum of squares (SST)
6
Regression sum of squares (SSR)
3.6
Residual sum of squares (SSE)
2.4
Sxx
10
Syy
6
Sxy
6
Mean of X
3
Mean of Y
4
Predicted y
5.8
Minimum mean-square error of the estimator
0.48
Worked out from NIST/SEMATECH e-Handbook of Statistical Methods, 4.1 Introduction to Process Modeling and 1.3.5.11 Linear Regression and 3 other sources.
x = 6 lies outside the fitted range [1, 5], so the prediction extrapolates beyond the data.

Your figures

Updates as you type
For multiple regression enter the rows one after another: x1, x2 for observation 1, then x1, x2 for observation 2, and so on.
For multiple regression, list one value per predictor in "Predictor values to predict at".

How this is worked out

8 steps
  1. n = 5 observations.
  2. Sxx = 10, Sxy = 6, Syy = 6.
  3. Slope b = Sxy / Sxx = 6 / 10 = 0.6
  4. Intercept a = ybar - b xbar = 4 - 0.6 x 3 = 2.2
  5. Fitted model: y = 2.2 + 0.6x
  6. SST = 6 splits into SSR = 3.6 explained and SSE = 2.4 unexplained, so R^2 = 0.6.
  7. Standard error of the estimate s = sqrt(SSE / 3) = 0.89442719.
  8. Prediction at 6: 5.8.
All coefficientstable
2.2, 0.6
Fitted valuestable
2.8, 3.4, 4, 4.6, 5.2
Residualstable
-0.8, 0.6, 1, -0.6, -0.2
Scatter points with the fittable
xyfittedresidual
122.8-0.8
243.40.6
3541
444.6-0.6
555.2-0.2

Its 5 worked examples are re-run on every release, last on 15 September 2026. What changed

Sources and references

4 sources
NIST/SEMATECH e-Handbook of Statistical Methods, 4.1 Introduction to Process Modeling and 1.3.5.11 Linear Regression
2012 · Normal equations, ANOVA decomposition and the standard errors of the estimates.
Draper, N.R. & Smith, H. (1998), Applied Regression Analysis, 3rd edition, Wiley
Weighted least squares and the inference used here.
McCullagh, P. & Nelder, J.A. (1989), Generalized Linear Models, 2nd edition, Chapman & Hall
Iteratively reweighted least squares for the logit link.
Kay, S.M. (1993), Fundamentals of Statistical Signal Processing: Estimation Theory, Prentice Hall, chapter 12
The linear minimum mean-square-error estimator and its error variance sigma_y^2 (1 - rho^2).

What the Least Squares Regression Line Calculator calculates

Fits a least-squares model to paired data and reports the equation, slope, intercept, correlation, R squared, adjusted R squared, standard errors, t and F tests, the ANOVA sums of squares, residuals and a prediction at any chosen x. Handles simple, multiple, weighted, exponential, power, logarithmic and binary logistic fits.

How to use this Least Squares Regression Line Calculator

Enter X values (predictor), Y values (response), Predict y at x = and Confidence level. Fitted equation updates as you type. Change one figure at a time to see what drives the result.

How the result is worked out

Open “How this is worked out” beside the result for the step-by-step calculation behind Fitted equation, Slope (b) and Intercept (a).

The method follows NIST/SEMATECH e-Handbook of Statistical Methods, 4.1 Introduction to Process Modeling and 1.3.5.11 Linear Regression, Draper, N.R. & Smith, H. (1998), Applied Regression Analysis, 3rd edition, Wiley, McCullagh, P. & Nelder, J.A. (1989), Generalized Linear Models, 2nd edition, Chapman & Hall and Kay, S.M. (1993), Fundamentals of Statistical Signal Processing: Estimation Theory, Prentice Hall, chapter 12.

What you can compare

Change one input at a time to see how it affects Fitted equation, Slope (b) and Intercept (a). The inputs you can vary are X values (predictor), Y values (response), Predict y at x = and Confidence level.

Results are general information, not financial, tax, legal, medical or engineering advice. Check any decision that matters with a qualified professional.

Embed this calculator on your website

Copy this code into any page. The calculator appears with the figures currently entered, sizes itself to fit, and a small credit line links back here. Free, no account, no ads inside it, no tracking of your readers. Set your own figures and fixed fields; Personal removes the credit line, sets your colour and shows you which sites use it.

Preview

See something wrong? Report a problem with this calculator

Frequently asked questions

How to find the least squares regression line on a Casio calculator?

Fits a least-squares model to paired data and reports the equation, slope, intercept, correlation, R squared, adjusted R squared, standard errors, t and F tests, the ANOVA sums of squares. Open “How this is worked out” beside the result to see each step for your own figures.

How to calculate least squares of a regression line?

It needs X values (predictor), Y values (response), Predict y at x = and Confidence level. Nothing else is required, and the figures stay in your browser.

How to make a regression line on a calculator?

The result gives Fitted equation, Slope (b), Intercept (a), All coefficients, Number of observations and Correlation r, each labelled with its unit so the figure can be read on its own.

Is the regression line the least squares line?

Fits a least-squares model to paired data and reports the equation, slope, intercept, correlation, R squared, adjusted R squared, standard errors, t and F tests, the ANOVA sums of squares. On the figures this page opens with — predict y at x = 6 — the fitted equation is y = 2.2 + 0.6x. Put your own figures in their place and the working updates beside the result.

How to calculate least squares regression line?

The page opens with worked default figures: fitted equation of y = 2.2 + 0.6x. Replace them with your own and every figure updates as you type.

How to find regression on TI-84?

The method comes from NIST/SEMATECH e-Handbook of Statistical Methods, 4.1 Introduction to Process Modeling and 1.3.5.11 Linear Regression, Draper, N.R. & Smith, H. (1998), Applied Regression Analysis, 3rd edition, Wiley and McCullagh, P. & Nelder, J.A. (1989), Generalized Linear Models, 2nd edition, Chapman & Hall, listed in full under Sources so the figures can be checked against the original.

Related calculators

View all related calculators6 more