Tutorials › Regression Analysis (Undergraduate) › Calculating Fitted Values for Given Predictors

Fitting a Simple Linear Regression · Tutorial 83 of 991

Calculating Fitted Values for Given Predictors

Use an estimated regression line to calculate and interpret fitted responses for specified predictor values.

Beginner 9 min read

What You'll Learn

  • Identify the estimated intercept and slope in a simple regression equation.
  • Substitute a specified predictor value to calculate a fitted response.
  • Calculate fitted responses for several predictor values and report appropriate units.
  • Interpret a fitted value as a point on the estimated line, not an observed response.
  • Distinguish the arithmetic of fitting values from claims about individual outcomes.

From a Fitted Line to a Fitted Response

Once a simple regression line has been estimated, it can be used to calculate a fitted response for any specified value of the predictor. The calculation is short, but its interpretation matters: the result is the response value assigned by the fitted line at that predictor value. It is not automatically the actual response of an individual or object with that predictor value.

For example, suppose a fitted equation relates hours spent studying to a quiz score. Substituting a particular number of study hours gives the score on the fitted line at that value. Reading that number correctly requires keeping track of which quantity is the predictor, which is the response, and what the fitted line represents.

The Model and the Fitted Equation

In simple linear regression, let \(x\) denote a predictor value and \(Y\) a response variable. A standard model for the response at predictor value \(x\) is

$$ Y=\beta_0+\beta_1x+\varepsilon. $$

Here \(\beta_0\) and \(\beta_1\) are the population intercept and slope, and \(\varepsilon\) represents the part of the response not described by the linear term. For the usual interpretation of the line as describing the mean response, the model assumes that the mean response changes linearly with \(x\), or equivalently that the errors have mean zero at each predictor value: \(E(\varepsilon\mid x)=0\). The estimated intercept and slope are written \(b_0\) and \(b_1\).

Once those estimates have been obtained, the estimated regression equation is

$$ \hat{y}=b_0+b_1x. $$

The symbol \(\hat{y}\) denotes the fitted response calculated from the estimated line. It is important to distinguish \(\hat{y}\) from \(Y\), which denotes the response variable, and from a particular observed response, often written \(y\). The fitted equation gives a calculated value; an observed response may differ from it.

Definition: For a specified predictor value \(x_0\), the fitted response is the value obtained by substituting \(x_0\) into the estimated regression equation: \(\hat{y}_0=b_0+b_1x_0\). The ordered pair \((x_0,\hat{y}_0)\) is a point on the fitted line.

To calculate a fitted response, use the coefficients in the estimated equation as given, substitute the specified predictor value for \(x\), and evaluate the expression. The intercept and slope have units determined by the variables: \(b_0\) is in response units, while \(b_1\) is in response units per predictor unit. Thus \(b_1x_0\) has response units and can be added to \(b_0\).

1
Write the fitted equation.
Identify the estimated intercept \(b_0\) and slope \(b_1\), including their signs.
2
Substitute the predictor value.
Replace \(x\) with the given value \(x_0\), keeping parentheses when they help show the substitution.
3
Calculate and interpret.
Evaluate the expression, then report the result in response units as the fitted response at \(x_0\).

Worked Calculations

Worked Example: Fitted Quiz Score at a Given Study Time

Suppose a hypothetical data set of students was used to estimate the equation \(\hat{y}=42+4.6x\), where \(x\) is study time in hours and \(\hat{y}\) is fitted quiz score in points. Calculate the fitted score for a student who studied for 5 hours.

The specified predictor value is \(x_0=5\) hours. Substitute it into the equation:

$$ \hat{y}_0=42+4.6(5) =42+23 =65. $$

The fitted quiz score at 5 hours of study is 65 points. This says that the estimated line has the point \((5,65)\), with the first coordinate measured in hours and the second in points. It does not say that every student who studies for 5 hours will score exactly 65 points.

Worked Example: Using a Negative Slope

For a hypothetical set of days, suppose a fitted equation for electricity use is \(\hat{y}=82-2.4x\), where \(x\) is the day's mean outdoor temperature in degrees Celsius and \(\hat{y}\) is fitted electricity use in kilowatt-hours. Find the fitted response at \(x_0=19\) degrees Celsius.

Substitute 19 for \(x\). The minus sign is part of the estimated slope, so it must remain in the calculation:

$$ \hat{y}_0=82-2.4(19) =82-45.6 =36.4. $$

At a mean outdoor temperature of 19 degrees Celsius, the fitted electricity use is 36.4 kilowatt-hours. The calculation follows the line as specified: it subtracts 2.4 kilowatt-hours for each one-degree increase in temperature from the fitted value at zero degrees. The result is a value on the estimated line, not a guarantee about electricity use on a particular day.

Worked Example: Calculating Several Fitted Responses

A hypothetical analysis gives the fitted equation \(\hat{y}=18.2+3.75x\), where \(x\) is fertilizer applied in kilograms per plot and \(\hat{y}\) is fitted crop yield in kilograms per plot. Calculate the fitted responses for \(x_0=0\) and \(x_0=4\) kilograms.

At \(x_0=0\):

$$ \hat{y}_0=18.2+3.75(0) =18.2+0 =18.2\text{ kilograms per plot}. $$

At \(x_0=4\):

$$ \hat{y}_0=18.2+3.75(4) =18.2+15 =33.2\text{ kilograms per plot}. $$

The fitted line assigns 18.2 kilograms per plot at zero kilograms of fertilizer and 33.2 kilograms per plot at 4 kilograms. These are two points on the same estimated line. The slope is positive, and the second fitted value is 15 kilograms per plot greater than the first, consistent with \(3.75\) kilograms per plot for each additional kilogram of fertilizer.

Why Substitution Gives a Point on the Line

A line described by \(\hat{y}=b_0+b_1x\) consists of the ordered pairs whose second coordinate equals \(b_0+b_1\) times the first coordinate. When the first coordinate is specified as \(x_0\), the corresponding second coordinate is obtained by replacing \(x\) with \(x_0\). This gives the point on the line without making any claim about whether a particular observed data point is located there.

The justification is simply substitution under the stated condition:

$$ \hat{y}=b_0+b_1x,\quad x=x_0 \quad\Longrightarrow\quad \hat{y}=b_0+b_1x_0 \quad\Longrightarrow\quad (x,\hat{y})=(x_0,b_0+b_1x_0). $$

The condition \(x=x_0\) is essential. The equation \(\hat{y}=b_0+b_1x\) describes all points on the line; by itself it does not say that the predictor coordinate equals any particular specified value. Adding that condition makes clear why the calculated pair is the point on the line at \(x_0\).

The arithmetic calculation itself requires only an estimated equation and a specified predictor value. The linear-mean and zero-mean-error assumptions are needed for the usual statistical interpretation of the fitted line as an estimate of the mean response pattern. Normal errors are not required just to perform the substitution.

Interpreting Fitted Values Carefully

A fitted response is a model-based value, not a newly observed measurement. If the response is measured in quiz points, the fitted response is in quiz points; if it is measured in kilowatt-hours, the fitted response is in kilowatt-hours. Keeping those units visible helps prevent confusing the predictor value with the calculated response.

Under the linear-mean model, the fitted value at \(x_0\) can be interpreted as the estimated mean response at that predictor value. It should not automatically be described as the response of a particular individual. Individual outcomes can vary around the mean relationship. To assert that an individual will have exactly the fitted value would overstate what the equation says.

The fitted intercept \(b_0\) is the fitted response when \(x=0\), since \(b_0+b_1(0)=b_0\). Whether that value has a useful practical meaning depends on what zero represents in context. The fitted slope \(b_1\) describes the change in fitted response for a one-unit increase in the predictor. These coefficient interpretations help check the direction and scale of a substitution, but the fitted response still comes from evaluating the full equation at the specified \(x_0\).

Common Mistake: Confusing the Equation With an Observation

A frequent error is to calculate \(\hat{y}\) and then report it as the observed response. For instance, after obtaining a fitted score of 65 points at 5 hours of study, it would be incorrect to say that a student who studied for 5 hours necessarily scored 65. The calculation establishes only that the fitted line assigns 65 points to \(x=5\).

Another common error is to omit a negative sign or to substitute a response value where the predictor value belongs. A useful check is to write the predictor and response with their units before calculating, then verify that the final answer has response units. In the electricity example, \(19\) is in degrees Celsius and is substituted for \(x\); the computed \(36.4\) is in kilowatt-hours and is the fitted response.

Key takeaway: Given an estimated simple regression equation and a predictor value \(x_0\), calculate the fitted response as \(\hat{y}_0=b_0+b_1x_0\). Report it as the value on the fitted line at \(x_0\), in response units—not as a guaranteed individual outcome.

Check Your Understanding

For each question, show the substitution and give the fitted response in context.

  1. A fitted equation is \(\hat{y}=12+3x\), where \(x\) is time in minutes and \(y\) is distance in meters. What is the fitted distance at \(x=7\) minutes?
  2. For \(\hat{y}=50-1.5x\), calculate the fitted response at \(x=12\). If \(y\) is measured in dollars, state the fitted response in context.
  3. In \(\hat{y}=b_0+b_1x\), what value of \(x\) gives the fitted response \(b_0\)? Explain using substitution.
  4. Why is it incorrect to claim that every observed response at \(x=7\) must equal the fitted response calculated at \(x=7\)?
  5. A fitted line is \(\hat{y}=8+2.5x\), with \(x\) in kilograms and \(y\) in liters. Calculate the fitted response at \(x=3\) and identify the units of the result.