A straight line can be used to predict Y from X. For each point, the error of prediction is the vertical difference between the point and the line. The squared error of prediction is the square of that value. The sum of squared errors of prediction and the sum of the absolute errors of prediction are both possible criteria for choosing a straight line. The sum of squared errors of prediction is the most commonly used.