Free calculatorLive resultsSteps and sourcesEmbed on your site, free

Line Regression Equation Calculator

Linear Regression Calculator works out Fitted equation and Slope (b) from X values (predictor), Y values (response) and Model. 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.
Only used by multiple regression; the X list is read row by row in this many columns.
One weight per observation for weighted least squares. Leave blank for equal weights.
For multiple regression, list one value per predictor in "Predictor values to predict at".
Multiple regression only: one value per predictor.

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 Linear Regression 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 Linear Regression Calculator

Enter X values (predictor), Y values (response), Model and Number of predictors. Fitted equation updates as you type, and “Use a worked example” loads checked figures you can adjust. 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.

Least-squares line through (1,2) (2,4) (3,5) (4,4) (5,5) example

With X values (predictor): 1,2,3,4,5, Y values (response): 2,4,5,4,5, Predict y at x =: 6, the calculator returns Slope (b): 0.6, Intercept (a): 2.2, R squared: 0.6. This example is checked against an independent source in the test suite.

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), Model, Number of predictors, Weights and Predict y at x =.

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 get linear regression on 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 do I perform linear regression on a TI-84 calculator?

It needs X values (predictor), Y values (response), Model, Number of predictors, Weights and Predict y at x =. Nothing else is required, and the figures stay in your browser.

How do I calculate linear regression?

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.

Can AI do linear regression?

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.

What information do I need for the Linear Regression Calculator?

You need X values (predictor), Y values (response), Model, Number of predictors, Weights, Predict y at x =, Predictor values to predict at and Confidence level. The page opens with default figures that give fitted equation of y = 2.2 + 0.6x, so you can see the scale before entering your own.

What does this Linear Regression Calculator show?

It shows Fitted equation, Slope (b), Intercept (a), All coefficients, Number of observations, Correlation r, R squared and Adjusted R squared, with the working and any warnings for your entries.

Related calculators

View all related calculators6 more