# LSRL Equation - Tutorial

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.

## Learn Least Square Regression Line Equation - Definition, Formula, Example

##### Definition

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.

##### Formula : Another formula for Slope: Slope = (N∑XY - (∑X)(∑Y)) / (N∑X2 - (∑X)2)
###### Where,
b = The slope of the regression line a = The intercept point of the regression line and the y axis. X = Mean of x values Y = Mean of y values SDx = Standard Deviation of x SDy = Standard Deviation of y
##### Example

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
##### To Find,

Least Square Regression Line Equation

##### Solution :
###### Step 1 :

Count the number of given x values.
N = 5

###### Step 2 :

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
###### Step 3 :

Now, Find ∑X, ∑Y, ∑XY, ∑X2 for the values ∑X = 311 ∑Y = 18.6 ∑XY = 1159.7 ∑X2 = 19359

###### Step 4 :

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

###### Step 5 :

Now, again substitute in the above intercept formula given. Intercept(a) = (∑Y - b(∑X)) / N = (18.6 - 0.18783783783783292(311))/5 = -7.964

###### Step 6 :

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