Linear Regression
A linear regression expresses the linear relation of a treatment variable to an outcome variable.
Regression Line
A regression line can be especially useful on a scatter plot.
The regression line passes through two points:
and
Regression Computation
Take the generic equation form of a line:
Insert the first point into this form.
This can be trivially rewritten to solve for a in terms of b:
Insert the second point into the original form.
Now additionally insert the solution for a in terms of b.
Expand all terms to produce:
This can now be eliminated into:
Giving a solution for b:
This solution is trivially rewritten as:
Expand the formula for correlation as:
This can now be eliminated into:
Finally, b can be eloquently written as:
Giving a generic formula for the regression line: