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.
- Calculate the means of x and y.
- Compute the slope: b = r(sᵧ/sₓ), where r is the correlation coefficient.
- Calculate the y-intercept: a = ȳ − bx̄.
- Write the equation ŷ = a + bx.
- 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̄