Linear Regression Calculator
This calculator fits a straight line through pairs of numbers by least squares. It gives the slope, the intercept, the equation, r squared and the standard error, and it predicts y for an x you choose.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use Linear Regression Calculator online
- Enter the pairs. Write one x and y pair per line.
- Type an x to predict. Optionally give an x to see the predicted y.
- Read the line. The slope, intercept, equation and r squared appear.
- Check the residuals. The table lists fitted values and residuals.
Why use this free Linear Regression Calculator
- Slope and intercept
- Equation of the line
- r squared and standard error
- Prediction for any x
- Residuals table
- CSV and PDF
Fitting a line
Least squares regression finds the straight line that makes the sum of the squared vertical gaps between the points and the line as small as possible. The result is an equation y = a + b x, which you can use to describe a trend or to predict y from x.
The formulas
The slope is the sum of (x − mean x)(y − mean y) divided by the sum of (x − mean x) squared. The intercept is the mean of y minus the slope times the mean of x. The page also gives r squared, the share of the variation in y that the line explains, and the standard error of the estimate.
A worked example
For the pairs (1, 2), (2, 4), (3, 5), (4, 4), (5, 5) the line is y = 2.2 + 0.6 x, with a slope of 0.6 and an intercept of 2.2. The r squared is 0.6. At x = 6 the predicted y is 5.8.
Residuals
A residual is the actual y minus the fitted y. The table lists the fitted values and residuals for up to 40 pairs. Residuals that are large, or that show a pattern, suggest that a straight line may not fit the data well.
Cautions about predicting
Predicting inside the range of your x values is safer than outside it, where the straight-line trend may not continue. The standard error shows the typical size of the misses, but it does not ensure the fit for new data.
Using the calculator
Results appear under the boxes and refresh as you edit them. Keep a result as scenario A, change a number and compare both.
Linear Regression Calculator: frequently asked questions
How do I find the slope?
What does r squared tell me?
How do I predict a y value?
What is a residual?
Why can the page not fit my data?
Can anyone see what I type into the Linear Regression Calculator?
Is there a way to keep the Linear Regression Calculator result?
Related searches for Linear Regression Calculator
- Linear Regression Calculator online
- free Linear Regression Calculator
- Linear Regression Calculator online free
- Linear Regression Calculator for mobile
- Linear Regression Calculator without sign up
- linear regression formula
- linear regression calculator with table
- Linear Regression Calculator – Math, Stats & Charts
Linear Regression Calculator is a free online tool on MAITBOX, in the Math, Stats & Charts group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.