How to find errors in Linear Regression?

Linear regression most often uses mean-square error (MSE) to calculate the error of the model. MSE is calculated by:

  1. Measuring the distance of the observed y-values from the predicted y-values at each value of x;
  2. Squaring each of these distances;
  3. Calculate the mean of each of the squared distances.

Linear regression fits a line to the data by finding the regression coefficient that results in the smallest MSE.