Linear
y = a + bx
What is Linear Regression ?
The technique of linear regression attempts to define the relationship between the dependent and independent variables by means of a linear equation.
This is the simplest form of equation between two variables.
Produces the slope of a line that best fits a single set of data.
How good is your line ?
You could find the difference between each point and the line.
These differences are often referred to as errors.
The errors above the line are positive and the errors below the line are negative.
If you add these errors together you will find that they total zero.
This doesn't prove that the line is a good one though.
The absolute values of the errors could be added up but the line of best fit is obtained when the sum of the squares of the errors is as small as possible.
Squaring the errors not only removes the sign but also gives more emphasis to the larger errors.
Method of Least Squares
oridinary least squares regression (or linear least squares)
Linear regrssion involves finding the line that minimises the sum of the squares of the errors.
You must always make sure that the y-variable is the dependent variable in the equation:
y = a + bx
The values of a and b that minise the squared errors is given by the following equation:
b = ( nSxy - SxSy ) / ( nSy2 - (Sx)2 )
this is the slope
a = (Sy / n) - b(Sx/n)
this is the intercept
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext