# Why do we use “Sum of Squared Errors” as loss function in linear regression? [duplicate]

What is a loss function? How can we relate the slope of Linear Regression with Sum of Squared Errors?

SSE is used in linear regression because it directly relates to the portion of the variance of outcome $$Y$$ that is not explained (cannot be contributed) to the difference is the values of (the) predictor(s) $$X$$. It is a measure of 'predicability' of the $$X$$'s for the value of $$Y$$.
The SSE directly relates to the slope of a linear regression model because it is the sum of the squared deviations of a given $$(X,Y)$$ from $$(X,\hat{Y})$$ where $$\hat{Y}$$ is the predicted value based on the model and the given $$X$$.