Linear regression allows for error calculation using mean-square error (MSE). to determine the error in SLR:
Measure distances between observed y-values and predicted y-values for each value of x.
Square each of the distances.
Determine the mean of each squared distance.
Based on one of its pre-suppositions of homoscedasticity, SLR plots a straight line for the data by determining a regression coefficient that will result in the smallest mean-square error.