HSC Class 12 Commerce · Mathematics & Statistics (Part II) · Chapter 3Last-day bento sheet

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

  1. 01Find x̄, ȳ or Raw Sums
  2. 02Compute b_YX & b_XY
  3. 03Write Lines Through (x̄, ȳ)
  4. 04Verify Signs & b_YX·b_XY ≤ 1
|r| ≤ 1
Correlation magnitude bound; r² = b_YX · b_XY ≤ 1
b_YX · b_XY = r²
Product of regression coefficients equals r squared
b_YX + b_XY ≥ 2r
AM-GM inequality when b_YX, b_XY, r are positive
(x̄, ȳ)
Point where both regression lines always intersect

1Concept and least squares

Y^=a+bX\hat{Y} = a + bX
e.g. Line Y = 2 + 0.75X predicts Y = 9.5 when X = 10.
∑yi=na+b∑xi,∑xiyi=a∑xi+b∑xi2\sum y_i = na + b\sum x_i, \quad \sum x_i y_i = a\sum x_i + b\sum x_i^2

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

bYX=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2=n∑xiyi−(∑xi)(∑yi)n∑xi2−(∑xi)2b_{YX} = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sum (x_i - \bar{x})^2} = \frac{n\sum x_i y_i - (\sum x_i)(\sum y_i)}{n\sum x_i^2 - (\sum x_i)^2}
e.g. cov(X,Y) = 12, σ_X = 4 ⇒ b_YX = 12/16 = 0.75.
bXY=∑(xi−xˉ)(yi−yˉ)∑(yi−yˉ)2=n∑xiyi−(∑xi)(∑yi)n∑yi2−(∑yi)2b_{XY} = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sum (y_i - \bar{y})^2} = \frac{n\sum x_i y_i - (\sum x_i)(\sum y_i)}{n\sum y_i^2 - (\sum y_i)^2}
e.g. r = 0.5, σ_X = 4, σ_Y = 3 ⇒ b_XY = 0.5×(4/3) = 2/3.
Y−yˉ=bYX(X−xˉ),X−xˉ=bXY(Y−yˉ)Y - \bar{y} = b_{YX}(X - \bar{x}), \quad X - \bar{x} = b_{XY}(Y - \bar{y})
e.g. x̄=25, ȳ=20, b_YX=0.375 ⇒ Y = 0.375X + 10.625.

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

r=±bYX⋅bXYr = \pm\sqrt{b_{YX} \cdot b_{XY}}
e.g. b_YX = −1.5, b_XY = −1/6 ⇒ r = −√(0.25) = −0.5.
0≤bYX⋅bXY≤10 \le b_{YX} \cdot b_{XY} \le 1
e.g. b_YX = 1.6 and b_XY = 0.8 gives 1.28 > 1 ⇒ inconsistent.
∣bYX+bXY∣≥2∣r∣|b_{YX} + b_{XY}| \ge 2|r|
e.g. b_YX = 0.2, b_XY = 0.4, r = 0.5 ⇒ 0.6 < 1.0 ⇒ inconsistent.

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

U=X−ah,V=Y−bkU = \frac{X - a}{h}, \quad V = \frac{Y - b}{k}
bYX=khbVU,bXY=hkbUVb_{YX} = \frac{k}{h} b_{VU}, \quad b_{XY} = \frac{h}{k} b_{UV}
e.g. U=(X−50)/10, V=(Y−100)/5 ⇒ b_YX = (5/10)b_VU = 0.5 b_VU.

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.

Regression of Y on X vs X on Y

VS
Purpose
Line of Y on X:Estimates dependent Y from given X.
Line of X on Y:Estimates dependent X from given Y.
Minimized Error
Line of Y on X:Minimizes vertical squared errors Σ(y_i − ŷ_i)².
Line of X on Y:Minimizes horizontal squared errors Σ(x_i − x̂_i)².
Line Equation
Line of Y on X:Y − ȳ = b_YX(X − x̄).
Line of X on Y:X − x̄ = b_XY(Y − ȳ).
Slope Formula
Line of Y on X:b_YX = cov(X,Y)/σ_X² = r(σ_Y/σ_X).
Line of X on Y:b_XY = cov(X,Y)/σ_Y² = r(σ_X/σ_Y).

Change of Origin vs Change of Scale

VS
Transformation
Change of Origin:u = X − a, v = Y − b (constant shift).
Change of Scale:U = (X − a)/h, V = (Y − b)/k.
Effect on b_YX, b_XY
Change of Origin:Invariant: b_YX = b_VU and b_XY = b_UV.
Change of Scale:Not invariant: b_YX = (k/h)b_VU.
Effect on r
Change of Origin:Unchanged: r(X,Y) = r(U,V).
Change of Scale:Magnitude unchanged when h, k > 0.
When Used
Change of Origin:Reduces large numbers without rescaling b.
Change of Scale:Used when data share common factors h, k.