Tutorials › Regression Analysis (Undergraduate) › Conditional Mean Predictions in Simple Regression

Predictions for Conditional Means · Tutorial 694 of 991

Conditional Mean Predictions in Simple Regression

Use a fitted simple regression equation to predict conditional means, interpret the slope as a difference between those means, and compare predictions with observed responses.

Beginner 9 min read

What You'll Learn

  • Distinguish a fitted conditional mean from an individual observed response.
  • Calculate fitted mean predictions at several values of one predictor.
  • Interpret the slope in units as a change between conditional means.
  • Compare fitted means with observed responses using residuals.
  • Recognize when a prediction is an extrapolation or a causal overinterpretation.

From a Regression Line to Conditional Mean Predictions

A fitted regression line gives a systematic way to estimate the response associated with a predictor value. In simple regression, there is one predictor, so we can calculate and compare estimated mean responses at different values of that predictor. These are conditional mean predictions: they estimate the average response among cases with a specified predictor value, not the response that every individual case will have.

For example, a line might estimate the average quiz score among students who study for a given number of hours. Students who study for the same number of hours can still earn different scores. The fitted mean describes the average pattern represented by the model; it does not remove the variation among students.

Definition: In a simple regression model, the conditional mean at predictor value \(x\) is the expected response for cases with that value, written \(\mu(x)=E(Y\mid X=x)\). If the conditional mean is linear, \(\mu(x)=\beta_0+\beta_1x\). The fitted conditional mean prediction is \(\hat{\mu}(x)=b_0+b_1x\), where \(b_0\) and \(b_1\) are the estimated intercept and slope. The observed response for one case is \(y\); it need not equal \(\hat{\mu}(x)\).

The model for the mean is \(E(Y\mid X=x)=\beta_0+\beta_1x\). Equivalently, an observed response can be represented as \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where the error has mean zero conditional on the predictor: \(E(\varepsilon_i\mid X_i=x_i)=0\). This is the assumption that makes the linear expression the conditional mean. For predictions to represent the setting of interest, the fitted linear mean should be a reasonable description over the predictor values being used. Independent observations and an appropriate sampling process also matter when generalizing beyond the observed cases. Constant error variance and normally distributed errors are not needed just to calculate a fitted mean.

How to Calculate and Read a Prediction

Once a fitted equation is available, substitute the chosen predictor value for \(x\), then carry out the arithmetic. The result is in the response variable's units. Keep the distinction between the two quantities clear: \(b_0+b_1x\) is the estimated mean response at \(x\), while \(y\) is the response observed for one case.

The slope also lets us compare two conditional mean predictions directly. For a change from \(x_1\) to \(x_2\), the fitted difference is the slope multiplied by the change in the predictor. This follows by subtracting the two fitted means:

$$ \hat{\mu}(x_2)-\hat{\mu}(x_1) =(b_0+b_1x_2)-(b_0+b_1x_1) =b_1(x_2-x_1). $$

The intercept cancels. Thus, for each one-unit increase in \(x\), the fitted conditional mean changes by \(b_1\) response units; for a change of several units, multiply \(b_1\) by that number of predictor units. This describes a difference between model-based means. It does not say that every individual response changes by that amount.

Worked Example: Predicting Quiz Scores at Several Study Times

Suppose a hypothetical sample of students produces the fitted equation \(\hat{\mu}(x)=10+2x\), where \(x\) is study time in hours and the response is quiz score in points. The sample scatterplot shows no marked curvature across the observed range of 1 to 5 hours. Calculate fitted means at 1, 3, and 5 hours, and compare them with the observed scores for students at those times.

At 1 hour, substitute \(x=1\):

$$ \hat{\mu}(1)=10+2(1)=12\text{ points}. $$

The observed score for the student who studied 1 hour is 11 points, so the observed response is 1 point below the fitted mean.

At 3 hours:

$$ \hat{\mu}(3)=10+2(3)=16\text{ points}. $$

The observed score for the student who studied 3 hours is 14 points, 2 points below the fitted mean. At 5 hours:

$$ \hat{\mu}(5)=10+2(5)=20\text{ points}. $$

The observed score at 5 hours is 19 points, 1 point below the fitted mean. These differences are observed response minus fitted mean: \(-1\), \(-2\), and \(-1\) points. They are not evidence that the arithmetic is inconsistent; individual responses vary around the mean pattern.

The fitted mean rises by \(2\) points per additional hour of study. From 1 to 5 hours, the predictor increases by 4 hours, so the fitted mean increases by \(2(4)=8\) points: \(20-12=8\). The linear mean model is plausible for the stated range, and these predictions are within the sample's observed predictor range. The results describe an association in this hypothetical sample, not proof that additional study causes a particular score increase.

The Slope as a Difference Between Means

The subtraction result is useful because it gives a consistent interpretation even when the predictor values are not one unit apart. If a fitted line has slope \(b_1=1.8\) response units per predictor unit, the fitted conditional mean at \(x+1\) is 1.8 response units above the fitted mean at \(x\). At \(x+5\), the fitted mean is \(1.8(5)=9\) response units above the fitted mean at \(x\), provided both values are within a range where the linear model is reasonable.

The units are part of the interpretation. If \(x\) is measured in kilograms and \(Y\) in kilograms, the slope is response kilograms per predictor kilogram. If a predictor is recorded in minutes but the slope is interpreted per hour, convert the units before describing the result. A numerical slope without its units or the context of the variables is incomplete.

Worked Example: Comparing Mean Yields at Different Fertilizer Amounts

In a hypothetical agricultural data set, the response is crop yield in kilograms per plot and the predictor is fertilizer amount in kilograms per plot. A fitted simple regression equation is \(\hat{\mu}(x)=42+1.8x\). A check of the scatterplot suggests a roughly linear mean pattern from 10 to 30 kilograms of fertilizer, and the plots were observed independently. Find the fitted mean yields at 10, 20, and 30 kilograms, and interpret the comparison with observed yields of 62, 75, and 100 kilograms at those respective predictor values.

For 10 kilograms:

$$ \hat{\mu}(10)=42+1.8(10)=42+18=60\text{ kg per plot}. $$

The observed yield at this predictor value is 62 kilograms, which is \(62-60=2\) kilograms above the fitted mean.

For 20 kilograms:

$$ \hat{\mu}(20)=42+1.8(20)=42+36=78\text{ kg per plot}. $$

The observed yield is 75 kilograms, or \(75-78=-3\) kilograms relative to the fitted mean. For 30 kilograms:

$$ \hat{\mu}(30)=42+1.8(30)=42+54=96\text{ kg per plot}. $$

The observed yield is 100 kilograms, 4 kilograms above that fitted mean. The observations do not have to lie on the line: each is one plot's response, while the prediction estimates a conditional average.

The fitted mean difference from 10 to 30 kilograms is \(1.8(30-10)=36\) kilograms per plot. This agrees with the direct calculation, \(96-60=36\) kilograms per plot. The slope therefore describes a 1.8-kilogram increase in fitted mean yield per additional kilogram of fertilizer. It does not guarantee that every plot gains 1.8 kilograms, and this observational regression alone does not establish a causal effect.

Predicted Means and Observed Responses Are Different

A fitted mean is a model-based summary at a predictor value. An observed response is a particular case's outcome. Their difference, observed response minus fitted mean, is called the residual for that case. A positive residual means the observed response is above the fitted mean; a negative residual means it is below. Residuals help describe how individual observations differ from the fitted line, but they do not change the meaning of the line as a prediction of the conditional mean.

A mean prediction can also be a decimal even when individual responses must be whole numbers. If a fitted model predicts 56.4 drinks sold at a temperature of 27 degrees Celsius, 56.4 is an estimated conditional average across comparable days, not a claim that a shop will sell four-tenths of a drink on a particular day.

Worked Example: Fractional Mean Predictions and Daily Sales

Suppose a hypothetical shop's daily sales of cold drinks are modeled by \(\hat{\mu}(x)=24+1.2x\), where \(x\) is the day's temperature in degrees Celsius and the response is drinks sold. The observed temperatures in the data range from 15 to 30 degrees Celsius; the plotted pattern is approximately linear in that range. Calculate the fitted means at 18, 22, and 27 degrees, then compare them with observed sales of 48, 47, and 60 drinks on three days with those temperatures.

At 18 degrees:

$$ \hat{\mu}(18)=24+1.2(18)=24+21.6=45.6\text{ drinks}. $$

The observed 48 drinks are \(48-45.6=2.4\) drinks above the fitted mean. At 22 degrees:

$$ \hat{\mu}(22)=24+1.2(22)=24+26.4=50.4\text{ drinks}. $$

The observed 47 drinks are \(47-50.4=-3.4\) drinks relative to the fitted mean. At 27 degrees:

$$ \hat{\mu}(27)=24+1.2(27)=24+32.4=56.4\text{ drinks}. $$

The observed 60 drinks are \(60-56.4=3.6\) drinks above the fitted mean. The predictions are all within the observed temperature range, and the assumed linear mean pattern is reasonable over that range. The fractional values are meaningful as estimated averages over days with the specified temperatures; they are not possible counts for a single day.

The slope is \(1.2\) drinks per degree Celsius. Between 18 and 27 degrees, the temperature difference is 9 degrees, so the fitted mean difference is \(1.2(9)=10.8\) drinks. Directly, \(56.4-45.6=10.8\) drinks. This comparison describes the fitted association, not a guaranteed increase in sales for every warmer day.

Using Predictions Responsibly

Before interpreting fitted means, consider whether the predictor values are within the range used to fit the line and whether a linear conditional mean is plausible there. A straight-line equation always returns a number, even far beyond the observed data, but that arithmetic does not make the result trustworthy. Extending the line beyond the data is extrapolation; the relationship may bend or change outside the studied range.

Also keep the target of the prediction clear. A conditional mean prediction addresses the expected response at a predictor value. It does not predict an individual's exact response, and a comparison of means is not automatically a causal claim. Causal interpretation requires a study design and assumptions that support it, not merely a fitted regression line.

  • State both variables and their units before describing a slope.
  • Substitute each requested predictor value into the fitted equation explicitly.
  • Use “fitted mean” or “estimated average response” when describing \(b_0+b_1x\).
  • Compare a particular observed response with the fitted mean without treating the difference as an error in the calculation.
  • Check that the predictor values fall within a range where the linear mean model is defensible.
Key takeaway: In simple regression, the fitted conditional mean at \(x\) is \(b_0+b_1x\). The slope \(b_1\) gives the fitted mean change per one-unit increase in the predictor, while individual observed responses can lie above or below that mean.

Check Your Understanding

Use a fitted equation \(\hat{\mu}(x)=8+3x\), where \(x\) is measured in hours and the response is measured in points.

  1. Calculate the fitted conditional mean at \(x=4\), including the response units.
  2. What is the fitted mean difference between \(x=2\) and \(x=6\)? Show how the slope gives the result.
  3. If the observed response at \(x=4\) is 18 points, is it above or below the fitted mean, and by how much?
  4. Explain why a fitted mean of 20.5 points can be meaningful even if individual scores must be whole numbers.
  5. What should be checked before using this line to predict at \(x=20\) hours?