Formula for Least Square Method
The formula used in the least squares method and the steps used in deriving the line of best fit from this method are discussed as follows:
- Step 1: Denote the independent variable values as xi and the dependent ones as yi.
- Step 2: Calculate the average values of xi and yi as X and Y.
- Step 3: Presume the equation of the line of best fit as y = mx + c, where m is the slope of the line and c represents the intercept of the line on the Y-axis.
- Step 4: The slope m can be calculated from the following formula:
m = [Σ (X – xi)×(Y – yi)] / Σ(X – xi)2
- Step 5: The intercept c is calculated from the following formula:
c = Y – mX
Thus, we obtain the line of best fit as y = mx + c, where values of m and c can be calculated from the formulae defined above.
Least Square Method
Least Square Method: In statistics, when we have data in the form of data points that can be represented on a cartesian plane by taking one of the variables as the independent variable represented as the x-coordinate and the other one as the dependent variable represented as the y-coordinate, it is called scatter data. This data might not be useful in making interpretations or predicting the values of the dependent variable for the independent variable where it is initially unknown. So, we try to get an equation of a line that fits best to the given data points with the help of the Least Square Method.
In this article, we will learn the least square method, its formula, graph, and solved examples on it.