Given a least squares line, we can use it for prediction. The equation
for prediction is simply the equation for a line with
and
replaced by their estimates. The predicted value of y is
traditionally denoted
(``y-hat''). Thus, suppose we are
given the least squares equation
where x is the age of a child in months and y is the height of that child, and let's further assume that the range of x is from 1 to 24 months. To predict the height of an 18 month old child, we just plug in to get
What if we wanted to know the height of a child at age 32 months? From our least squares equation, we could get a prediction. However, we're predicting outside of the range of our x values. This is called extrapolation and is not ``legal'' in good statistics unless you are very sure that the line is valid. When we predict within the range of our x values, this is known as interpolation; this is the way we want to predict.