⇤ ← Revision 1 as of 2023-10-28 05:18:15
Size: 1390
Comment:
|
Size: 1293
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Linear Regression = | = Ordinary Least Squares = |
Line 3: | Line 3: |
A linear regression expresses the linear relation of a treatment variable to an outcome variable. | '''Ordinary Least Squares''' ('''OLS''') is a linear regression method. It minimizes root mean square errors. |
Line 11: | Line 11: |
== Regression Line == A regression line can be especially useful on a scatter plot. |
== Univariate == |
Line 22: | Line 20: |
---- == Regression Computation == |
Ordinary Least Squares
Ordinary Least Squares (OLS) is a linear regression method. It minimizes root mean square errors.
Contents
Univariate
The regression line passes through two points:
and
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: