Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

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.

How to use Linear Regression Calculator online

  1. Enter the pairs. Write one x and y pair per line.
  2. Type an x to predict. Optionally give an x to see the predicted y.
  3. Read the line. The slope, intercept, equation and r squared appear.
  4. 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?
Divide the sum of the products of the deviations of x and y by the sum of the squared deviations of x.
What does r squared tell me?
How much of the variation in y the line accounts for, from 0 to 1.
How do I predict a y value?
Type an x in the predict box. The page puts it into the equation.
What is a residual?
The difference between an actual y and the y the line gives.
Why can the page not fit my data?
If all x values are the same, no line can be fitted, and the page says so.
Can anyone see what I type into the Linear Regression Calculator?
No. The Linear Regression Calculator does its sum in your browser, and nothing is uploaded.
Is there a way to keep the Linear Regression Calculator result?
The link of the page holds the Linear Regression Calculator numbers, so a bookmark brings them back.

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.

More tools in Math, Stats & Charts →

Search tools