Statistics Calculator: Linear Regression

Use this page to derive and draw the line of best fit from a set of bivariate data.

Online Linear Regression Calculator

This page allows you to compute the equation for the line of best fit from a set of bivariate data:

  1. Enter the bivariate x,y data in the text box. x is the independent variable and y is the dependent variable. Data can be entered in two ways:

    x values in the first line and y values in the second line, or ...
    individual x,y values on separate lines.

    Individual values within a line may be separated by commas, tabs or spaces. This flexibility in the input format should make it easier to paste data taken from other applications or from text books.
  2. Press the "Submit Data" button to perform the computation.
  3. To clear the graph and enter a new data set, press "Reset".
  4. If the calculations were successful, a scatter plot representing the data will be displayed. On the same plot you will see the graphic representation of the linear regression equation. Above the scatter plot, the variables that were used to compute the equation are displayed, along with the equation itself.
  5. You can now enter an x-value in the box below the plot, to calculate the predicted value of y
  6. To clear the graph and enter a new data set, press "Reset".

What is simple linear regression

Simple linear regression is a way to describe a relationship between two variables through an equation of a straight line, called line of best fit, that most closely models this relationship.

Linear Regression Formula

This calculator uses the following formula to derive the equation for the line of best fit:

$ y = a+bx $


$ b = \frac{\sum_{i=1}^n x_i y_i - n \bar{x} \bar{y}}{\sum_{i=1}^n x_i^2 - n \bar{x}^2} $ and $ a = \bar{y} - b \bar{x}$

Another Calc

what is the lcm of 2 and 7 1 cent equal to how many square yards lowest term in fraction formula for sample variance statistic 1 nanogram to milligram converter square meters to square feet 67cm in inch sq feet to sq meter conversion feet to square foot conversion calculator conversion from m2 to sq ft how many centigrams in a milligram