3.4 Simple Linear Regression: Math

  • RSS = residual sum of squares

RSS=e21+e22++e2n

RSS=(y1ˆβ0ˆβ1x1)2+(y2ˆβ0ˆβ1x2)2++(ynˆβ0ˆβ1xn)2

ˆβ1=ni=1(xiˉx)(yiˉy)ni=1(xiˉx)2 ˆβ0=ˉyˆβ1ˉx

  • ˉx, ˉy = sample means of x and y

3.4.1 Visualization of Fit

Contour and three-dimensional plots of the RSS on the `Advertising` data, using `sales` as the response and `TV` as the predictor. The red dots correspond to the least squares estimates $\hat\beta_0$ and $\hat\beta_1$, given by (3.4)

Figure 3.2: Contour and three-dimensional plots of the RSS on the Advertising data, using sales as the response and TV as the predictor. The red dots correspond to the least squares estimates ˆβ0 and ˆβ1, given by (3.4)

Learning Objectives:

  • Perform linear regression with a single predictor variable. ✔️