Linear Least Squares Regression Line Equation Calculator
Calculates the Slope (m), Y-Intercept, and Least Squares Regression Line Equation for a given set of X and Y values.
Calculator
This calculator accepts any number of X-Y data pairs and calculates the Least Squares Regression Line Equation.
The least squares regression method determines the line of best fit by minimizing the sum of squared differences between observed and predicted Y-values.
If X is the independent variable and Y is the dependent variable, the regression equation is:
Y = b0 + b1X
- Where:
- b0 = Y-intercept
- b1 = Slope of the regression line
The slope indicates the average change in Y for a one-unit change in X. The intercept represents the estimated value of Y when X equals zero.
How the Least Squares Regression Line is Calculated
The least squares regression line is obtained by calculating the slope and intercept that minimize the total squared error between the observed values and the predicted values.
Slope Formula:
m = [n(ΣXY) − (ΣX)(ΣY)] / [n(ΣX²) − (ΣX)²]
Intercept Formula:
b = [(ΣY)(ΣX²) − (ΣX)(ΣXY)] / [n(ΣX²) − (ΣX)²]
Where:
- n = Number of data pairs
- ΣX = Sum of X values
- ΣY = Sum of Y values
- ΣXY = Sum of products XY
- ΣX² = Sum of X squared values
The resulting regression equation is:
Y = b + mX