From an Estimated Line to Individual Responses
An estimated regression line summarizes the fitted response associated with a predictor value. For an observed predictor value \(x_i\), the line gives a fitted response, written \(\hat{y}_i\). The observed response \(y_i\) need not equal that fitted value. Their difference is the residual \(e_i\). Keeping these three quantities distinct is essential: the fitted value comes from evaluating the estimated line, the observed response comes from the data, and the residual records how far apart they are.
This calculation is used whenever a regression result is interpreted at particular data points. In a hypothetical insurance analysis, for example, a line might relate a policy-level predictor to an observed claim measure. Evaluating the line gives a fitted claim measure for a policy's predictor value; comparing it with the recorded response gives that policy's residual. The calculation describes the data relative to the estimated line, not a new observation or a guaranteed outcome.
The coefficients \(\hat{\beta}_0\) and \(\hat{\beta}_1\) are estimates, and \(\hat{y}_i\) is a value calculated from those estimates at the observed \(x_i\). A fitted value is not automatically the actual observed response. In particular, the symbol \(\hat{y}_i\) identifies the line's value at \(x_i\), whereas \(y_i\) identifies the response recorded for observation \(i\).
Calculate, Compare, Decompose
Use the same sequence for each observation: evaluate the estimated line at its predictor value, subtract the fitted value from the observed response to obtain the residual, and verify the decomposition. Keep the response units consistent throughout. If \(y_i\) is measured in hours, then \(\hat{y}_i\) and \(e_i\) are also measured in hours.
Substitute \(x_i\) into \(\hat{y}_i=\hat{\beta}_0+\hat{\beta}_1x_i\) to calculate the fitted response.
Use the stated sign convention \(e_i=y_i-\hat{y}_i\): observed response minus fitted response.
Add the fitted response and residual. The sum must equal the observed response: \(\hat{y}_i+e_i=y_i\).
Worked Example: Workload Index and Processing Hours
In a hypothetical study of claim-processing work, an estimated line relates a workload index \(x\) to processing hours \(y\): \(\hat{y}=18+2.5x\). The predictor is measured in index points and the response in hours. For one work unit, \(x_i=4\) and the observed response is \(y_i=31\) hours. Calculate its fitted response and residual, and verify the decomposition.
Method. Evaluate the estimated line at \(x_i=4\), subtract that fitted response from the observed response, then check that the two components sum to the observation.
Fitted response. \[ \hat{y}_i=18+2.5(4)=18+10=28\text{ hours}. \]
Residual. \[ e_i=y_i-\hat{y}_i=31-28=3\text{ hours}. \]
Decomposition check. \[ \hat{y}_i+e_i=28+3=31\text{ hours}=y_i. \] The observed response is 3 hours above the fitted response. The common mistake to avoid is reversing the subtraction: the residual is observed minus fitted, not fitted minus observed.
Why the Decomposition Holds
The decomposition is an algebraic identity based on the definition of a residual. It does not require a special assumption about the distribution of the responses, nor does it require a particular method for estimating the line. The line must be specified to calculate a fitted value, but once that value is calculated, the identity follows directly.
The cancellation of \(\hat{y}_i\) and \(-\hat{y}_i\) explains why adding the residual back to the fitted value recovers the observed response exactly. This is a point-by-point decomposition: it applies separately to each observation. It does not say that the fitted value alone equals the observed response, or that the residual is zero.
Worked Example: Review Time and Prior Notice
A hypothetical insurer uses the estimated line \(\hat{y}=42-1.5x\) to summarize review time \(y\), in minutes, by prior-notice time \(x\), in days. For a case with \(x_i=6\), the recorded review time is \(y_i=34\) minutes. For a second case with \(x_i=10\), the recorded time is \(y_i=29\) minutes. Calculate each fitted value and residual, and check both decompositions.
Method. Substitute each case's own \(x_i\) into the line. Then calculate \(e_i=y_i-\hat{y}_i\) separately for each case.
First case, \(x_1=6\). \[ \hat{y}_1=42-1.5(6)=42-9=33\text{ minutes}. \] \[ e_1=34-33=1\text{ minute},\qquad 33+1=34\text{ minutes}. \] The first observed review time is 1 minute above its fitted value.
Second case, \(x_2=10\). \[ \hat{y}_2=42-1.5(10)=42-15=27\text{ minutes}. \] \[ e_2=29-27=2\text{ minutes},\qquad 27+2=29\text{ minutes}. \] The second observed review time is 2 minutes above its fitted value.
Check. In both cases, the fitted response plus the residual recovers the stated observed response. The negative slope affects how the fitted response changes with \(x\); it does not change the residual definition or its sign convention.
Residual Signs, Units, and Centered Predictors
The sign of a residual describes the observed response's position relative to its fitted value. If \(e_i>0\), then \(y_i>\hat{y}_i\): the observation is above the fitted value. If \(e_i<0\), then \(y_i<\hat{y}_i\): it is below the fitted value. A residual of zero means \(y_i=\hat{y}_i\) for that observation. These comparisons are made on the response scale.
A line can also be written using a centered predictor, such as \(\hat{y}=a+b(x-c)\). In that form, evaluate the expression as written at the observation's \(x_i\). The centering changes how the line is represented, not the calculation of the fitted value or the definition of the residual. The same decomposition applies.
Worked Example: A Centered Predictor and a Negative Residual
For a hypothetical portfolio review, an estimated line relates an activity measure \(x\) to an average review score \(y\): \(\hat{y}=105+4(x-20)\). Both the fitted and observed responses are scores. For a record with \(x_i=17\), the observed score is \(y_i=91\). Calculate the fitted score and residual, and state whether the observation is above or below its fitted value.
Method. Substitute \(x_i=17\) into the centered expression without dropping the subtraction of 20. Then subtract fitted from observed.
Fitted response. \[ \hat{y}_i=105+4(17-20)=105+4(-3)=105-12=93. \]
Residual. \[ e_i=91-93=-2. \]
Decomposition check and interpretation. \[ \hat{y}_i+e_i=93+(-2)=91=y_i. \] The residual is \(-2\) score points, so the observed score is 2 points below its fitted value. The common mistake to avoid is using \(4(17)\) instead of \(4(17-20)\), which would evaluate a different line.
Common Mistakes and a Reliable Check
Most errors in this calculation come from confusing which value is observed, which is fitted, or which order to use in the subtraction. A quick decomposition check catches many of them.
- Reversing the residual subtraction. Use \(e_i=y_i-\hat{y}_i\). A fitted response of 28 and observed response of 31 give residual \(31-28=3\), not \(-3\).
- Calling a fitted value an observation. The line gives \(\hat{y}_i\); the recorded data give \(y_i\). Keep the labels attached to the correct numbers.
- Dropping a centered term. If the line contains \(x-c\), substitute into the entire expression, including the subtraction of \(c\).
- Mixing response units. The observed response, fitted response, and residual must all be on the same response scale and in the same units.
- Skipping the check. If \(\hat{y}_i+e_i\ne y_i\), revisit the substitution or subtraction before interpreting the sign.
The calculation is deliberately local to each observation: use its predictor value to get its fitted response, then compare that response with its own observed value. This keeps the arithmetic transparent and avoids treating a fitted value as if it were an additional recorded datum.
Check Your Understanding
For each problem, calculate the fitted response and residual, and check the decomposition. All responses are in the units stated in the problem.
- An estimated line for a hypothetical service measure is \(\hat{y}=7+2x\). At \(x_i=5\), the observed response is \(y_i=20\). Find the fitted response and residual. (Answer: \(\hat{y}_i=17\), \(e_i=3\), and \(17+3=20\).)
- A hypothetical review-time line is \(\hat{y}=50-4x\), with time measured in minutes. For \(x_i=7\), the observed time is 18 minutes. Find the fitted time and residual, and interpret its sign. (Answer: \(\hat{y}_i=22\) minutes, \(e_i=-4\) minutes; the observation is 4 minutes below its fitted value.)
- An estimated centered line is \(\hat{y}=80+3(x-10)\). For \(x_i=14\), the observed response is \(y_i=96\). Find the fitted response and residual. (Answer: \(\hat{y}_i=92\), \(e_i=4\), and \(92+4=96\).)
- A hypothetical cost measure has estimated line \(\hat{y}=12+0.8x\). At \(x_i=15\), the observed cost is 23 units. Calculate the fitted cost and residual, including the decomposition check. (Answer: \(\hat{y}_i=24\), \(e_i=-1\), and \(24+(-1)=23\).)
- A hypothetical portfolio measure has estimated line \(\hat{y}=30+1.25x\). For two records, the predictor and observed response pairs are \((8,41)\) and \((12,43)\). Calculate both fitted responses and residuals. (Answer: at \(x=8\), \(\hat{y}=40\), \(e=1\); at \(x=12\), \(\hat{y}=45\), \(e=-2\).)