mindstair

Home / Courses / Introductory Statistics / Unit 9

Introductory Statistics Unit 9: Regression

Regression models the relationship between two quantitative variables with a line, and measures how well the line fits.

Covers: Scatterplots, correlation, least-squares regression, residuals, r-squared

Study guide

Regression describes relationships between two quantitative variables. Start with a scatterplot of the explanatory variable (x) against the response variable (y), and describe its direction (positive or negative), form (linear or curved), strength, and any unusual points.

The correlation r measures the strength and direction of a linear relationship. It ranges from −1 to 1, has no units, doesn't change if you swap x and y or change units, and is strongly affected by outliers. It only measures linear association, and correlation does not imply causation.

The least-squares regression line ŷ = a + bx minimizes the sum of squared residuals. Its slope is b = r(s_y/s_x), and it always passes through (x̄, ȳ). Interpret the slope as the predicted change in y for each one-unit increase in x, and the intercept as the predicted y when x = 0 (only if that makes sense). Predicting outside the range of the data is extrapolation and is unreliable.

A residual is actual − predicted, y − ŷ. A residual plot with no pattern means a linear model is appropriate; a curved pattern means it isn't. The standard deviation of the residuals, s, gives the typical prediction error. The coefficient of determination r² is the percent of the variation in y explained by the linear model with x.

Outliers have large residuals, while influential points (often with extreme x-values) substantially change the slope or correlation when removed.

To test for a linear relationship, use t = (b − β₀)/SE_b with df = n − 2. A confidence interval for the true slope β is b ± t*·SE_b, with b and SE_b read from computer output. Before slope inference, check that the form is linear, the observations are independent (with the 10% condition), the residuals are roughly normal, the residual spread is about equal across x, and the data come from a random sample or experiment.

A confidence interval for a mean response estimates the average y for all individuals with a given x. A prediction interval estimates one individual's y. It is always wider, because it adds the scatter of individuals around the line. Regression output lists the intercept and slope in the coefficient column, each with its standard error, t-statistic and p-value. It also reports s, the typical residual size, and r².

Key ideas

Formulas and rules

ŷ = a + bx
b = r·(s_y / s_x)
Line passes through (x̄, ȳ)
Residual = y − ŷ

Common mistakes

Words to know

Residual formula
Residual = actual − predicted = y − ŷ
Slope of the least-squares line
b = r·(s_y / s_x)
Coefficient of determination (r²)
The percent of variation in y explained by the linear model with x.
Residual plot
No pattern means a linear model is appropriate.
Correlation coefficient (r)
Strength and direction of a linear relationship; −1 to 1, no units.
Slope of a regression line (b)
The predicted change in y for each one-unit increase in x.
Extrapolation
Predicting outside the range of the data's x-values; unreliable.
Explanatory vs. response variable
x explains or predicts y.
Scatterplot
A graph of paired quantitative data.
Least-squares regression line
ŷ = a + bx, minimizing the sum of squared residuals.
Regression line passes through
(x̄, ȳ)
Standard deviation of residuals (s)
The typical prediction error.
Influential point
A point that substantially changes the slope or correlation when removed.
Outlier (regression)
A point with a large residual.

Sample practice questions

23 more questions like these, from level 1 to 5, are in the practice set.

Question 1 (level 1)

r = −0.9 means…

  1. A strong positive relationship
  2. A weak negative relationship
  3. A strong negative linear relationship
  4. No relationship
Show the answer and steps

Answer: C) A strong negative linear relationship

  1. r
  2. = 0.9 is close to 1, and the sign is negative.
  3. Strong negative linear relationship.
Question 2 (level 1)

ŷ = 26 + (−3)x. Predict y when x = 6.

  1. −18
  2. 153
  3. 5
  4. 8
Show the answer and steps

Answer: D) 8

  1. Substitute x = 6: 26 + (−3)(6) = 8.
Question 3 (level 3)

Same model. Actual y = 15 at x = 5. Residual?

  1. −2
  2. 15
  3. 13
  4. 2
Show the answer and steps

Answer: D) 2

  1. Residual = actual − predicted.
  2. 15 − 13 = 2.