Skip to content

Statistics · Ch 3 — Linear Regression

Computing Regression Equations from Raw Data

4

Computing Regression Equations from Raw Data

To find the two regression equations from a set of paired observations (Xi,Yi)(X_i, Y_i), follow these steps:

  1. Compute nn, ΣX\Sigma X, ΣY\Sigma Y, ΣXY\Sigma XY, ΣX2\Sigma X^{2}, ΣY2\Sigma Y^{2}.
  2. Find the means: Xˉ=ΣXn\bar{X} = \dfrac{\Sigma X}{n}, Yˉ=ΣYn\bar{Y} = \dfrac{\Sigma Y}{n}.
  3. Compute the two regression coefficients using the direct (raw-score) formulas:

byx=nΣXY−ΣXΣYnΣX2−(ΣX)2,bxy=nΣXY−ΣXΣYnΣY2−(ΣY)2b_{yx} = \frac{n\Sigma XY - \Sigma X \Sigma Y}{n\Sigma X^{2} - (\Sigma X)^{2}}, \qquad b_{xy} = \frac{n\Sigma XY - \Sigma X \Sigma Y}{n\Sigma Y^{2} - (\Sigma Y)^{2}}

  1. Substitute Xˉ\bar{X}, Yˉ\bar{Y} and the coefficients into the deviation-form equations from the previous section, and simplify into the form Y=a+byxXY = a + b_{yx}X or X=a′+bxyYX = a' + b_{xy}Y.
  2. Sanity-check: both lines must pass through (Xˉ,Yˉ)(\bar{X}, \bar{Y}), and byx⋅bxyb_{yx} \cdot b_{xy} must not exceed 1. …