From a Fitted Line to a Prediction
A fitted regression equation turns a specified value of an explanatory variable into a predicted value of a response variable. This is a direct calculation: identify the given explanatory value, put it into the equation, and evaluate. The arithmetic is usually brief, but a useful answer also names the predicted quantity, includes its units, and distinguishes the prediction from what will actually happen to an individual.
For example, suppose a fitted line relates hours spent studying to quiz score. If a question gives a study time of 4 hours, the regression equation can be used to calculate the line’s predicted score at that value. The result is not necessarily any student’s actual score. It is the response value assigned by the fitted line to the specified study time.
The coefficients \(b_0\) and \(b_1\) are determined from paired data. When software reports a regression equation, its intercept and slope are the values to use in that equation. The prediction calculation does not require refitting the line: it evaluates the already-fitted equation at the requested explanatory value.
A Reliable Substitution Procedure
Before calculating, make sure the value supplied in the question belongs to the explanatory variable and is expressed in the units used to fit the line. Then substitute it for \(x\), preserve the signs and parentheses, and calculate the resulting \(\hat{y}\). Finally, state what \(\hat{y}\) measures in the situation.
Determine what \(x\) represents, what \(y\) represents, and the units of the given explanatory value.
Use the intercept and slope as reported, including a negative sign if the slope is negative.
Replace \(x\) with the supplied value and show the arithmetic leading to \(\hat{y}\).
Name the response, give its units, and make clear that the value is predicted by the fitted line.
The calculation follows directly from the equation’s meaning. At any selected explanatory value \(x_0\), the point on the fitted line has coordinates \((x_0,\hat{y})\). Substituting \(x_0\) into the line’s equation gives the second coordinate:
This is the complete justification for the calculation: the predicted response is the vertical coordinate of the fitted line at the specified horizontal coordinate. The operation is substitution, not a separate statistical estimate from newly collected data.
Worked Example: Predicting a Quiz Score
Hypothetical example. A teacher fits a least-squares regression line to paired data on study time and quiz score. The explanatory variable \(x\) is study time in hours, and the response \(y\) is quiz score in points. The fitted equation is \(\hat{y}=42.6+5.15x\). What score does the line predict for a student who studied 4.5 hours?
The supplied explanatory value is \(x=4.5\) hours. Substitute 4.5 for \(x\):
The fitted line predicts a quiz score of about 65.8 points for a study time of 4.5 hours. The slope has units of points per hour, so multiplying it by 4.5 hours gives a score measured in points; the intercept is also measured in points.
This is the line’s predicted score at 4.5 hours, not a claim that every student who studies that long will earn 65.8 points. Individual scores can differ from the fitted prediction.
Keeping the Equation and Units Straight
Regression equations may appear in mathematical notation or as software output. In either form, identify which coefficient is the intercept and which is the slope before substituting. A line reported as “intercept = 8.2, slope = 3.4” means \(\hat{y}=8.2+3.4x\), not \(8.2x+3.4\). The equation’s variables and units determine how to describe the resulting prediction.
Units also provide a useful check on the arithmetic. The intercept has the same units as the response. The slope has response units per explanatory-variable unit, so slope multiplied by \(x\) has response units. Consequently, both terms in the equation can be added to produce a predicted response.
Worked Example: Using Coefficients Reported by Software
Hypothetical example. Software reports an intercept of 8.2 and a slope of 3.4 for a fitted line relating bicycle commute distance \(x\), in kilometers, to commute time \(y\), in minutes. Find the predicted commute time for a distance of 6 kilometers.
The response is commute time, measured in minutes. The software coefficients give the equation \(\hat{y}=8.2+3.4x\). Substitute \(x=6\):
The fitted line predicts a commute time of 28.6 minutes for a 6-kilometer bicycle commute. The product \(3.4\text{ minutes per kilometer}\times6\text{ kilometers}\) is 20.4 minutes, so it can be added to the intercept, 8.2 minutes.
The prediction is for the response variable, commute time. It is not a prediction of distance, because distance is the explanatory variable that was supplied.
A negative slope is handled in the same way as a positive slope: preserve the negative sign when substituting. A negative fitted slope means that the line’s predicted response decreases as the explanatory value increases. In a single prediction calculation, it contributes a negative amount to the intercept.
Worked Example: Substituting a Negative Slope
Hypothetical example. A fitted line relates the number of hours since a device was fully charged, \(x\), to its remaining battery charge, \(y\), in percentage points. The equation is \(\hat{y}=98.4-6.25x\). Calculate the predicted remaining charge after 7.2 hours.
Here \(x=7.2\) hours. Substitute this value and keep the minus sign in the equation:
The fitted line predicts 53.4 percentage points of battery charge after 7.2 hours. The slope’s units are percentage points per hour, and its contribution at 7.2 hours is \(-45.0\) percentage points.
The minus sign belongs to the slope’s contribution. Replacing the subtraction with addition would give a different result and would not evaluate the reported fitted line.
What a Prediction Represents
A prediction is a value calculated from the fitted equation, not a recorded response for a particular individual. In a context where the line is used to describe the response level associated with an explanatory value, \(\hat{y}\) represents the line’s estimated response at that value. For an individual outcome, the actual response may be above or below the prediction.
The arithmetic alone cannot establish that the fitted line is appropriate for every situation or every explanatory value. Interpret the result in light of the data and context on which the line was fitted. The explanatory variable must be understood in the same way and measured in the same units as in the fitted equation. A calculated number may be exact as an evaluation of the equation while still being a poor guide to a real response if the equation is not suitable for that use.
A fitted association also does not, by itself, show that changing \(x\) causes a change in \(y\). The prediction describes what the fitted line assigns to a supplied explanatory value. A causal claim requires grounds beyond the substitution calculation.
Common Mistakes
- Putting the supplied value in the wrong place. The given explanatory value replaces \(x\), not \(\hat{y}\). The result after substitution is the predicted response.
- Reversing the coefficients. In \(\hat{y}=b_0+b_1x\), the intercept is added and the slope is multiplied by \(x\). Do not multiply the intercept by the explanatory value.
- Dropping a negative sign. If the fitted equation has a negative slope, retain its sign throughout the substitution and arithmetic.
- Reporting a number without context or units. A complete response names the predicted quantity, such as “28.6 minutes,” rather than giving only “28.6.”
- Treating the prediction as a guaranteed outcome. The line gives a fitted value. It does not ensure that a particular individual’s observed response will equal that value.
Check Your Understanding
For each question, show the substitution and state the predicted response in context.
- A fitted line for weekly exercise time \(x\), in hours, and a fitness score \(y\), in points, is \(\hat{y}=31+4.2x\). What score does it predict for \(x=3\) hours?
- A software report gives intercept \(12.5\) and slope \(-1.8\). Write the fitted equation, then calculate its prediction at \(x=4\).
- For the equation \(\hat{y}=6+2.5x\), the explanatory variable is measured in meters and the response is measured in seconds. What are the units of the slope and of a prediction?
- Explain why a fitted prediction of 65.8 points does not mean that every individual with the specified explanatory value will have an observed response of 65.8 points.
- A fitted line is \(\hat{y}=9+3x\). A student substitutes a supplied explanatory value into the position of \(\hat{y}\) and calls the result a prediction. Identify the mistake and describe the correct substitution.