Fitting a straight line to bivariate data is known as linear regression and is particularly useful in finding a relationship between two variables.
In this example, there are 5 data points above and below the line. The two points that could be used to find the gradient is (30, 25) and (60, 65). The gradient, m, is therefore 1.33. Using the point (30, 25) again, the c value is -15. The estimated line is therefore
However, this method is not unique and is not easily reproduced. Because of this, it is preferred that a least square regression line is used.
The least squares regression line is used to fit straight line to data. An alternative method is the three median regression line. This method is based on minimising the sum of the squared values of the residuals.
The equation of the least squares regression line is:
where is the slope, given by
and is the intercept, given by
is the correlation coefficient
and are the standard deviations of x and y
and are the mean values of x and y
If this method is used using the data on the previous page for Test 1 and Test 2, the equation would be:
This is a more accurate formula.
Want to suggest an edit? Have some questions? General comments? Let us know how we can make this resource more useful to you.