Least Squares Method
Least Squares is the most common method to calculate a linear regression.
To calculate the equation of the least squares line
- Start with the usual slope equation
y = mx + b
- Calculate the mean and standard dev of both
- Calculate the
r coefficient (get a number between -1 and 1)
- Replace the mean of
y in the slope equation
m = (StdDev(y) * r) / StdDev(x)
b = Mean(y) - (m * Mean(x)). You now have the value of
m so just swap that in.
- Now you can complete the initial equation with the new values for
- 202009011233 Statistics - Khan Academy