Linear Regression
Big idea: How least squares fits two straight regression lines through (x̄, ȳ) using b_YX and b_XY to predict X or Y.
Big picture flow
- 01Find x̄, ȳ or Raw Sums
- 02Compute b_YX & b_XY
- 03Write Lines Through (x̄, ȳ)
- 04Verify Signs & b_YX·b_XY ≤ 1
1Concept and least squares
Two lines exist because Y on X minimizes vertical errors while X on Y minimizes horizontal errors.
Trick: Least squares penalizes big misses harshly by squaring errors before adding them up.
2Regression lines and coefficients
Second subscript always goes in the denominator of b_YX and b_XY.
Trick: In b_YX, the second letter X goes to the bottom (denominator); in b_XY, the second letter Y goes to the bottom.
3Properties of coefficients
Check consistency using same signs, product ≤ 1, and |b_YX + b_XY| ≥ 2|r|.
Trick: Three musketeers: b_YX, b_XY, and r always march with the same sign, and one cannot let the other cross 1 together.
4Origin shift and solving lines
Solve the two lines for (x̄, ȳ); test b_YX · b_XY ≤ 1 to label each line.
Trick: Origin shift is free (no factor); scale shift flips back with k/h for Y on X.
Key terms glossary
- Linear Regression:
- Fitting a linear equation to estimate the average value of a dependent variable from an independent one.
- Residual (e_i):
- Vertical difference y_i − ŷ_i between an observed value and the line's predicted value.
- Coefficient b_YX:
- Slope of Y on X showing change in Y per unit change in X; equals cov(X,Y)/σ_X² or r(σ_Y/σ_X).
- Coefficient b_XY:
- Coefficient of X on Y showing change in X per unit change in Y; equals cov(X,Y)/σ_Y² or r(σ_X/σ_Y).
- Invariance Property:
- b_YX and b_XY stay unchanged under origin shift, but scale by k/h and h/k under scale change.
- Normal Equations:
- Pair Σy = na + bΣx and Σxy = aΣx + bΣx² derived by minimizing squared residuals.