MaizePrepSTATS 250
Exam 3 · Lec 16

Correlation and the fitted line

Describe scatterplots, compute predictions and residuals, and interpret model fit.

25 minDraft

Key ideas

Correlation r

A unitless measure from −1 to 1 of linear direction and strength. It is sensitive to outliers; near-zero correlation can hide a curved relationship.

Describing a scatterplot

Give the form (linear or not), strength (how tightly the points cluster), direction (positive or negative) and any unusual points, in context. Say "no apparent outliers" rather than declaring that a point is an outlier: the course gives no formal outlier test.

OLS line

The ordinary least squares line y^=β^0+β^1x\hat y=\hat\beta_0+\hat\beta_1x, the line that makes the sum of squared residuals as small as possible. R computes it; read β^0\hat\beta_0 and β^1\hat\beta_1 from the Estimate column of the summary output.

Residual

Observed response minus fitted response. A positive residual means the model underpredicted the observed outcome.

R-squared

The proportion of sample response variation accounted for by the fitted model. In simple regression with an intercept it equals r squared.

Leverage and influence

Leverage means an unusual predictor value. Influence means the fitted model changes appreciably when that observation is removed; high leverage need not imply influence.

Formulas

Fitted value and residual
y^=β^0+β^1x,e=y−y^\hat y=\hat\beta_0+\hat\beta_1x,\qquad e=y-\hat y
Slope units are response units per predictor unit.
Fit
R2=1−SSESST,RSE=SSEn−2R^2=1-\frac{SSE}{SST},\qquad RSE=\sqrt{\frac{SSE}{n-2}}
RSE has response units; R-squared has no units. Judge RSE against the response SD: a much smaller RSE means the predictor beats always guessing the mean.

Which procedure?

Two quantitative variables and a roughly linear pattern
Scatterplot, correlation, and simple linear regression.
Prediction outside the observed predictor range
Flag extrapolation; do not assume the fitted trend persists.
Worked example

Delivery distance and travel time

For 26 deliveries with distances from 1 to 8 km, predict time at 5 km and find the residual for an actual time of 25 minutes. This is an original example with composed R output.

summary(lm(minutes ~ km, data = deliveries))
# Coefficients table (Estimate column only)
            Estimate
(Intercept)       12
km                 2
Residual standard error: 3 on 24 degrees of freedom
Multiple R-squared:  0.64,	Adjusted R-squared:  0.625

sd(deliveries$minutes)
[1] 4.898979
  1. Substitute 5 into the fitted equation: 12 + 2(5) = 22 minutes.

  2. Slope: each additional kilometer is associated with about 2 more minutes of travel time, on average. Intercept: 0 km is outside the observed 1–8 km range, so the 12 minutes only anchors the equation; it is not a meaningful delivery time.

  3. Residual = 25 − 22 = +3 minutes: this delivery took longer than predicted.

  4. Use Multiple R-squared (ignore Adjusted in simple regression): about 64% of the variation in delivery time is explained by its linear relationship with distance; the other 36% is left to other factors.

  5. r is not printed: r = +√0.64 = 0.8, positive because the slope is positive.

  6. RSE = 3 minutes: actual times typically differ from predicted times by about 3 minutes. Ignoring distance and always guessing the mean time would typically miss by the SD, about 4.9 minutes, so distance improves the predictions.

Answer

Predicted time is 22 minutes, with a +3 minute residual. A prediction at 20 km would extrapolate beyond these data.

Three-question check

1
Lec 16

A line predicts 18 liters and the observed value is 15 liters. The residual is:

2
Lec 16

Changing distance from kilometers to meters leaves which quantity unchanged?

3
Lec 16

Which observation has high leverage?

MaizePrep is an independent study resource. It is not affiliated with, sponsored by, or endorsed by the University of Michigan. Course names and numbers are used only to describe which class the material covers. Every practice question is original, written in the style of the course.