Least-squares regression

Math

Definition

A statistical method that finds the line of best fit by minimizing the sum of the squared vertical distances (residuals) between the data points and the line. The resulting equation is ŷ = a + bx, where b is the slope and a is the y-intercept.

How It Works

  1. Calculate the means of x and y.
  2. Compute the slope: b = r(sᵧ/sₓ), where r is the correlation coefficient.
  3. Calculate the y-intercept: a = ȳ − bx̄.
  4. Write the equation ŷ = a + bx.
  5. Interpret slope and intercept in context.

Examples

  • Predicting a student's test score based on hours studied
  • Modeling the relationship between advertising spending and sales
  • Estimating home price based on square footage
Key Fact

Slope: b = r(sᵧ/sₓ), y-intercept: a = ȳ − bx̄

Study This Concept

Practice least-squares regression with free review games in these units: