Animated Linear Regression

Regression Equation

y = 0.0000 × x + 0.0000

Total Error (Sum of Squared Residuals): 0.0000

0246802468
FastSlow
How the Best Fit Line Works

1. Calculate mean of X and Y - Find the "center" of the data.

2. Calculate slope - Using the formula: slope = Σ(x-x̄)(y-ȳ) / Σ(x-x̄)²

3. Calculate y-intercept - Using the formula: intercept = ȳ - slope × x̄

4. Minimize residuals - The green dotted lines show the errors (distances) between actual and predicted values.

5. Sum of squared errors - The optimal line minimizes the sum of these squared errors.

Data Points
X
Y
1
3
2
5
3
4
4
7
5
8