Math

Least-squares regression.

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 · 5 phases

Step by step.

  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

Real-world.

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

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

Studied in

1 unit use this concept.