Use of Regression for Prediction, If the correlation coefficient is high enough,
we can use the regression equation to predict what the value of y will be for
different values of x that we don't have data for.
This can be very powerful.
Take a look at this example.
Suppose you have some data on a neighborhood lemonade stand
that shows you how many cups of lemonade were sold when the stand set
various prices between $0.25 and $1.50 per cup.
The price is the independent variable and
the demand in cups is the dependant variable.
The equation of the regression line is 34.1-16.3x.
And the correlation between the two variables is -0.97.
The correlation value is negative because the demand decreases as
the price increases, as represented by the downwards slope of the graph.
And the absolute value of the correlation is very close to 1 because
the data is very close to a straight line.
Now we don't have a data point for when price is $0.60,
though we might want to predict what the sales will be if we set up that price.
Based on the regression equation, we can predict that at a price of
$0.60 the sales will be 34.1-16.3 (.60) = 24.3 cups.
Powerful, these predictions are only appropriate if we're reasonably within
the range of the data and if we're predicting like things.
For example, we wouldn't want to use this regression equation to predict
how many cups we would sell if we price them at $20 or
if we wanted to switch to selling water instead of lemonade.
Let's look at our first example from the first module.
Gas consumed by your car as a function of miles driven.
In this case, our correlation coefficient will likely be very close to positive 1,
since it is a strong linear relationship.
Suppose that you collect data from your car on your trips,
ranging from 200 to 1000 miles, and obtain the following equation.
y hat = 0.19 + 0.048 x with r = .92.
Here y hat is the gas consumed in gallons and x is the miles driven.
See if you can estimate how much gas would be used by your car to take a 650
mile trip.
You can plug 650 in for the x in the regression equation and
obtain 31.39 gallons
Now suppose you would like to take a friend's car on a 500 mile trip.
Can you estimate the gas needed from this regression line?
No, you can't, because the data came from your car and
his or her would have a different regression line.
Similarly, you would not want to use this line to predict
how much gas will be consumed on a two mile trip.
Remember that the data came from trips ranging from 200 to 1,000 miles.
A short two mile trip may not have the same gas mileage.