From a Regression Equation to a Fitted Mean
A fitted regression equation turns a predictor value into a corresponding fitted mean of the outcome. Once the equation and the predictor value are specified, the calculation is direct: substitute the value for the predictor, follow the order of operations, and report the result in the outcome’s units. The arithmetic is simple, but careful attention to signs and units is essential.
For example, a hypothetical equation might relate a route’s length in kilometres to the fitted mean travel time in minutes. Evaluating the equation at a route length of 4.5 kilometres gives a fitted mean travel time for that predictor value. It does not give the actual travel time for any particular trip.
The Model and What the Calculation Requires
To state the model behind the equation, let \(Y\) be the outcome and \(X\) the predictor. A simple linear conditional-mean model can be written as
This model assumes that the mean of \(Y\), among cases with predictor value \(x\), follows a straight-line function of \(x\). A corresponding fitted equation replaces the unknown population coefficients \(\beta_0\) and \(\beta_1\) with their fitted estimates, \(\hat{\beta}_0\) and \(\hat{\beta}_1\). The calculation in this tutorial evaluates that fitted equation; it does not estimate new coefficients.
The arithmetic of substituting a value does not require a normal distribution for the errors. It does require that the equation, coefficient values, and predictor units are read correctly. Interpreting the result as an estimate of a conditional mean relies on the linear conditional-mean model being appropriate for the setting. In addition, a prediction at an \(x\) value far outside the values used to fit the model may be unreliable; evaluating the equation is still possible, but the arithmetic alone does not establish that the model is suitable there.
Before calculating, identify four things: the predictor value to substitute, the intercept, the slope, and the outcome’s measurement units. The slope’s units also provide a useful check: it has outcome units per one predictor unit. Thus, when the slope is multiplied by \(x\), the product has outcome units, matching the intercept and the final fitted mean.
A Reliable Substitution Procedure
Use the fitted equation exactly as written. In particular, do not replace the intercept with zero, change the sign of the slope, or convert the predictor value unless you also ensure it is expressed in the units used by the equation.
Record the fitted intercept and slope, including their signs, and identify the predictor’s units.
Replace \(x\) with the specified predictor value while leaving both fitted coefficients unchanged.
Multiply the slope by the predictor value first, then add the intercept. Keep enough digits during the calculation to avoid premature rounding.
Give the fitted mean with the outcome’s units, and identify the predictor value at which it was calculated.
Worked Example: Travel Time at a Given Route Length
Suppose a hypothetical fitted equation gives mean travel time in minutes, \(Y\), from route length \(X\) in kilometres:
Calculate the fitted mean travel time for a route that is 4.5 kilometres long.
The predictor value is \(x=4.5\), measured in kilometres. Substitute it into the equation:
The fitted mean is 26.35 minutes, or about 26.4 minutes if rounding to one decimal place. The units are consistent: the slope is 3.1 minutes per kilometre, so \(3.1(4.5)\) is 13.95 minutes, which can be added to the 12.4-minute intercept.
Why the Intercept and Slope Matter in Substitution
The intercept is the equation’s value when \(x=0\), because the slope term then vanishes:
The slope controls how the fitted value changes when the predictor changes. For any two predictor values \(x_1\) and \(x_2\), subtracting the two fitted values gives
The intercept cancels, so a change of \(x_2-x_1\) predictor units changes the fitted mean by the slope multiplied by that change. This is also a useful check on a calculation: a positive slope means the fitted equation increases as \(x\) increases, while a negative slope means it decreases. This describes the equation’s direction, not necessarily a causal effect.
Worked Example: A Negative Slope and a Decimal Predictor
In a hypothetical process, a fitted equation relates operating time \(x\), in hours, to a mean quality score \(\hat{y}(x)\), in score points:
Find the fitted mean quality score after 6.4 hours.
Substitute \(x=6.4\). The slope is negative, so the product is subtracted:
The fitted mean score is 70.8 points at 6.4 hours. The calculation is consistent with the negative slope: the fitted value is below the intercept of 82.0 points. The product \(1.75(6.4)\) is 11.2 points because the slope is measured in score points per hour.
Units and the Meaning of the Predictor Value
A number cannot be substituted safely until its units are clear. If a model was fitted with a predictor measured in hours, entering a value in minutes without converting it changes the input by a factor of 60. Likewise, if the equation uses a rescaled predictor, such as hundreds of dollars rather than dollars, the numeric input must use that same scale.
The intercept’s units are the outcome’s units. The slope has outcome units divided by predictor units, so the product of the slope and a predictor value has outcome units as well. Adding that product to the intercept is therefore dimensionally appropriate. This unit check will not catch every arithmetic error, but it can reveal many mistaken conversions.
Worked Example: Converting the Predictor to the Equation’s Units
A hypothetical fitted equation predicts an outcome \(Y\) in units from a predictor \(X\) measured in tens of units:
Here one unit of \(x\) represents 10 units of the predictor in its original scale. Calculate the fitted mean when the original-scale predictor value is 35 units.
First express 35 original-scale units in the equation’s predictor units:
Now substitute \(x=3.5\):
The fitted mean is 7.8 outcome units for an original-scale predictor value of 35 units. Substituting 35 directly would be incorrect because the equation’s \(x\) is measured in tens of original-scale units, not individual original-scale units.
Rounding and Reporting the Result
Carry extra digits through the multiplication and addition, then round the final result to a sensible precision. The precision should reflect how the equation’s coefficients and the application are reported; there is no requirement that every answer use the same number of decimal places. If the calculated mean is 26.35 minutes, reporting 26.4 minutes may be clear, while reporting 26 minutes may be appropriate when tenths of a minute are not meaningful in context.
A complete report names the fitted mean, the outcome units, and the predictor value. For example: “At a route length of 4.5 kilometres, the fitted mean travel time is 26.4 minutes.” This is more informative than reporting “26.4” alone, and it does not claim that every route of that length has exactly that travel time.
Common Mistakes
- Using the wrong sign. A slope of \(-1.75\) means the term is \(-1.75x\), not \(+1.75x\). Substitute the signed coefficient as written.
- Changing the intercept. The intercept is included even when the predictor value is not zero. Only at \(x=0\) does the slope term equal zero.
- Mixing predictor units. An input measured in minutes cannot be entered into an equation fitted with hours unless it is converted to hours first.
- Calling the fitted mean an individual outcome. The equation gives a fitted mean at the specified predictor value, not a guarantee about any one observation.
- Rounding too early. Keep the full product during the calculation and round the final fitted mean, rather than rounding intermediate values unnecessarily.
Check Your Understanding
For each question, show the substitution and arithmetic, then state the fitted mean with units when they are given.
- A fitted equation for outcome \(Y\) is \(\hat{y}(x)=9+2.5x\). What fitted value does it give at \(x=3.2\)?
- A fitted equation is \(\hat{y}(x)=48-0.6x\), where \(x\) is measured in hours and \(Y\) in points. Calculate the fitted mean at \(x=15\) hours.
- Why would it be incorrect to substitute 120 into an equation whose predictor is measured in hours when the specified value is 120 minutes?
- In \(\hat{y}(x)=7+1.4x\), what is the fitted value at \(x=0\), and which part of the equation determines it?
- A fitted equation gives a value of 18.7 outcome units at a specified predictor value. Does that mean every individual with that predictor value has outcome 18.7? Explain.