Least Square Regression Line (LSRL equation) method is the accurate way of finding the 'line of best fit'. Line of best fit is the straight line that is best approximation of the given set of data. It helps in finding the relationship between two variable on a two dimensional plane. It can also be defined as 'In the results of every single equation, the overall solution minimizes the sum of the squares of the errors. Follow the below tutorial to learn least square regression line equation with its definition, formula and example.
Least square regression is a method for finding a line that summarizes the relationship between the two variables, at least within the domain of the explanatory variable x.
This tutorial helps you to calculate the least square regression line equation with the given x and y values. Consider the values
X Values | Y Values |
60 | 3.1 |
61 | 3.6 |
62 | 3.8 |
63 | 4 |
65 | 4.1 |
Least Square Regression Line Equation
Count the number of given x values.
N = 5
Find XY, X2 for the given values. See the below table
X Value | Y Value | X*Y | X*X |
60 | 3.1 | 60 * 3.1 =186 | 60 * 60 = 3600 |
61 | 3.6 | 61 * 3.6 = 219.6 | 61 * 61 = 3721 |
62 | 3.8 | 62 * 3.8 = 235.6 | 62 * 62 = 3844 |
63 | 4 | 63 * 4 = 252 | 63 * 63 = 3969 |
65 | 4.1 | 65 * 4.1 = 266.5 | 65 * 65 = 4225 |
Now, Find ∑X, ∑Y, ∑XY, ∑X2 for the values ∑X = 311 ∑Y = 18.6 ∑XY = 1159.7 ∑X2 = 19359
Substitute the values in the above slope formula given. Slope(b) = (N∑XY - (∑X)(∑Y)) / (N∑X2 - (∑X)2) = ((5)*(1159.7)-(311)*(18.6))/((5)*(19359)-(311)2) = (5798.5 - 5784.6)/(96795 - 96721) = 0.18783783783783292
Now, again substitute in the above intercept formula given. Intercept(a) = (∑Y - b(∑X)) / N = (18.6 - 0.18783783783783292(311))/5 = -7.964
Then substitute these values in regression equation formula Regression Equation(y) = a + bx = -7.964 + 0.188x Suppose if we want to calculate the approximate y value for the variable x = 64 then, we can substitute the value in the above equation Regression Equation(y) = a + bx = -7.964 + 0.188(64) = 4.068