Residuals

Residuals are the leftover stuff (variation) in the data after accounting for model fit: \[\text{data} = \text{prediction} + \text{residual}\]

Residuals

  • Each observation has its own residual.
  • The residual for an observation \((x,y)\) is the difference between observed (\(y\)) and predicted (\(\hat{y}\)): \[e = y - \hat{y}\]
  • We denote the residuals by \(e\) and find \(\hat{y}\) by plugging \(x\) into the regression equation.

Note: If an observation lands above the regression line, \(e > 0\). If below, \(e < 0\).

Residuals

Goal: get each residual as close to 0 as possible.

To shrink the residuals toward 0, we minimize: \[ \begin{align} \sum_{i=1}^n e_i^2 &= \sum_{i=1}^n (y_i - \hat{y}_i)^2 \\ & = \sum_{i=1}^n [y_i - (b_0 + b_1 x_i)]^2 \end{align} \]

The values \(b_0\) and \(b_1\) that minimize this will make up our regression line.

Finding \(b_0\) and \(b_1\)

  • The slope is \[b_1 = \frac{s_y}{s_x}\times R\]
  • The intercept is \[b_0 = \bar{y} - b_1 \bar{x}\]

Example: Old Faithful Geyser in Yellowstone

  • eruptions, the length of each eruption
  • waiting, the time between eruptions

Example: Old Faithful Geyser in Yellowstone

The sample statistics for these data are

waiting eruptions
mean \(\bar{x}=70.90\) \(\bar{y}=3.49\)
sd \(s_x=13.60\) \(s_y=1.14\)
\(R = 0.90\)

Find the regression line and interpret the parameters.

Example: Old Faithful Geyser in Yellowstone

Checkpoint

Consider a dataset on height and age of \(n=84\) Loblolly pine trees.

  • We want to use tree height to predict tree age.

The sample statistics for these data are

height age
mean \(32.36\) \(13.00\)
sd \(20.67\) \(7.90\)
\(R = 0.99\)

Find the regression line and interpret the parameters.

The Coefficient of Determination

The coefficient of determination, \(R^2\), is the square of the correlation coefficient.

  • This value tells us how much of the variability around the regression line is accounted for by the regression.
  • An easy way to interpret this value is to assign it a letter grade.
    • For example, if \(R^2 = 0.84\), the predictive capabilities of the regression line get a B.