Tutorials › Regression Analysis (Undergraduate) › Predicted Means from Quadratic Regression

Predictions for Conditional Means · Tutorial 701 of 991

Predicted Means from Quadratic Regression

Use a quadratic regression equation to calculate fitted means and describe how its curvature changes predicted outcomes across the observed range.

Beginner 9 min read

What You'll Learn

  • Evaluate a fitted quadratic regression at specified predictor values
  • Distinguish a fitted conditional mean from an individual outcome
  • Calculate and interpret predicted changes across predictor intervals
  • Explain how the quadratic term affects the curve’s slope
  • Locate a quadratic curve’s turning point and assess whether it is in range
  • Avoid interpreting a quadratic coefficient as a constant change per predictor unit

Why Predicted Means Change Across a Quadratic Curve

In a straight-line regression, the fitted mean changes by the same amount for each one-unit increase in the predictor. A quadratic regression allows the fitted relationship to bend: the predicted change may grow, shrink, reach zero, or reverse direction as the predictor increases. This is useful when a straight line does not adequately describe the pattern over the range of observed predictor values.

The goal here is to evaluate a fitted quadratic equation at selected values and interpret its curve in context. These calculations describe fitted conditional means, not guaranteed outcomes for particular individuals. The curve also summarizes an association; by itself, it does not establish that changing the predictor causes a change in the outcome.

The Quadratic Regression Model

Definition: A quadratic regression model for a quantitative outcome \(Y\) and quantitative predictor \(X\) specifies the conditional mean as \(E(Y\mid X=x)=\beta_0+\beta_1x+\beta_2x^2\). Here \(\beta_0\), \(\beta_1\), and \(\beta_2\) are model coefficients, and the quadratic coefficient \(\beta_2\) determines the curve’s curvature. The fitted mean at \(x\) is \(\hat{\mu}(x)=\hat{\beta}_0+\hat{\beta}_1x+\hat{\beta}_2x^2\), where the hats denote estimated coefficients.

A common model statement is \(Y_i=\beta_0+\beta_1x_i+\beta_2x_i^2+\varepsilon_i\), where \(\varepsilon_i\) is the deviation of observation \(i\) from the conditional mean at \(x_i\). For the usual regression interpretation, the errors have conditional mean zero, \(E(\varepsilon_i\mid x_i)=0\); observations are treated as independent when fitting the model. The quadratic form must also be a reasonable description of the conditional mean over the predictor range being interpreted. Constant error variance and normally distributed errors are not needed just to substitute values into a fitted equation and calculate fitted means.

The fitted equation is obtained by estimating the three coefficients from data. Once it is available, evaluating the curve is direct: substitute the chosen predictor value for \(x\), calculate \(x^2\), and then perform the arithmetic. If \(x\) is measured in hours and \(Y\) in points, for example, \(\hat{\beta}_1\) has units of points per hour and \(\hat{\beta}_2\) has units of points per hour squared. The linear coefficient is not, by itself, the change in fitted mean for every one-hour increase.

Worked Example: Evaluating Fitted Means at Selected Hours

Suppose a hypothetical analysis of study time and quiz score gives the fitted equation \(\hat{\mu}(x)=12+3x-0.25x^2\), where \(x\) is study time in hours and the outcome is quiz score in points. Suppose the observed study times range from 0 to 8 hours. Find the fitted means at 2, 4, and 6 hours, and describe the predicted changes.

At 2 hours, substitute \(x=2\):

$$ \hat{\mu}(2)=12+3(2)-0.25(2^2)=12+6-1=17\text{ points}. $$

At 4 hours and 6 hours:

$$ \hat{\mu}(4)=12+3(4)-0.25(4^2)=12+12-4=20\text{ points}, $$
$$ \hat{\mu}(6)=12+3(6)-0.25(6^2)=12+18-9=21\text{ points}. $$

The fitted mean increases by \(20-17=3\) points from 2 to 4 hours, and by \(21-20=1\) point from 4 to 6 hours. Both intervals are two hours long, but the predicted increases are different. The quadratic curve is flattening over these values; the calculation does not imply that every student’s score will follow these fitted means.

How to Describe the Curve’s Predicted Changes

For two predictor values \(x_1\) and \(x_2\), the difference in fitted means is the fitted value at \(x_2\) minus the fitted value at \(x_1\). Substituting the quadratic equation and factoring gives a useful expression for that finite change:

$$ \begin{aligned} \hat{\mu}(x_2)-\hat{\mu}(x_1) &=\hat{\beta}_1(x_2-x_1)+\hat{\beta}_2(x_2^2-x_1^2)\\ &=(x_2-x_1)\left[\hat{\beta}_1+\hat{\beta}_2(x_1+x_2)\right]. \end{aligned} $$

The intercept cancels because it contributes equally to both fitted means. The factored expression shows that the change depends on both the length of the predictor interval and where that interval lies. In contrast, for a straight line the difference would be \(\hat{\beta}_1(x_2-x_1)\), determined by interval length alone.

The local slope can be found by differentiating the fitted curve with respect to \(x\):

$$ \frac{d\hat{\mu}(x)}{dx}=\hat{\beta}_1+2\hat{\beta}_2x. $$

This slope describes the fitted curve’s instantaneous rate of change near a given \(x\), in outcome units per predictor unit. It is not the exact change across a finite interval unless the curve is linear. The second derivative is \(2\hat{\beta}_2\), so a positive quadratic coefficient means the slope increases as \(x\) increases, while a negative coefficient means it decreases. For a negative quadratic coefficient, the curve bends downward; for a positive coefficient, it bends upward.

When \(\hat{\beta}_2\ne 0\), the slope is zero at \(x^*=-\hat{\beta}_1/(2\hat{\beta}_2)\), the curve’s turning point. A negative quadratic coefficient makes this point a maximum, and a positive one makes it a minimum. A turning point is relevant to the data only if it lies within the observed predictor range. A calculated vertex outside that range should not be used to claim that the observed relationship actually turns there.

Worked Example: Finding a Turning Point and Checking Its Range

Suppose a hypothetical fitted model relates a measured response to a dose \(x\), in milligrams: \(\hat{\mu}(x)=20+6x-0.4x^2\). The observed doses range from 0 to 12 mg. Calculate fitted means at 3, 6, and 9 mg, and identify the turning point.

Substitution gives:

$$ \begin{aligned} \hat{\mu}(3)&=20+6(3)-0.4(3^2)=20+18-3.6=34.4,\\ \hat{\mu}(6)&=20+6(6)-0.4(6^2)=20+36-14.4=41.6,\\ \hat{\mu}(9)&=20+6(9)-0.4(9^2)=20+54-32.4=41.6. \end{aligned} $$

The slope is \(6-0.8x\), which equals zero when \(x=6/0.8=7.5\) mg. Since the quadratic coefficient is \(-0.4\), the curve bends downward and the turning point is a maximum. Its fitted mean is:

$$ \hat{\mu}(7.5)=20+6(7.5)-0.4(7.5^2)=20+45-22.5=42.5. $$

The turning point lies inside the observed dose range of 0 to 12 mg. The fitted mean rises from 34.4 at 3 mg to 41.6 at 6 mg, then is also 41.6 at 9 mg; the curve’s maximum is between 6 and 9 mg. These are descriptions of the hypothetical fitted association, not a dose recommendation or evidence of a causal effect.

Centered Predictors and the Same Fitted Curve

A predictor may be centered by subtracting a chosen reference value before it is squared. This changes the coefficients’ numerical values and their direct interpretations, but not the fitted means when the equation is rewritten consistently. For example, if \(z=x-5\), then a fitted curve written in \(z\) uses \(z\) and \(z^2\), not \(x\) and \(x^2\). The reliable way to evaluate it is to calculate \(z\) from the stated definition and substitute that value.

Worked Example: Evaluating a Centered Quadratic Equation

Suppose a hypothetical fitted equation for an outcome measured in units is \(\hat{\mu}(x)=30-1.2(x-5)+0.08(x-5)^2\), where \(x\) is measured in hours and the observed range is 2 to 8 hours. Calculate fitted means at the endpoints and at 5 hours.

At 2 hours, \(x-5=-3\); at 5 hours, \(x-5=0\); and at 8 hours, \(x-5=3\). Therefore:

$$ \begin{aligned} \hat{\mu}(2)&=30-1.2(-3)+0.08(-3)^2=30+3.6+0.72=34.32,\\ \hat{\mu}(5)&=30-1.2(0)+0.08(0)^2=30,\\ \hat{\mu}(8)&=30-1.2(3)+0.08(3)^2=30-3.6+0.72=27.12. \end{aligned} $$

The fitted mean decreases by \(34.32-30=4.32\) units between 2 and 5 hours, and by \(30-27.12=2.88\) units between 5 and 8 hours. Both intervals are three hours, yet the predicted decrease is smaller in the second interval. The calculations use values within the observed range and account for the centered predictor correctly.

Interpretation, Range, and a Common Mistake

A fitted mean at \(x\) summarizes the model’s estimated average outcome for observations at that predictor value. It is not an individual prediction: individual outcomes can differ from the conditional mean. When explaining a curve, give the predictor and outcome units, compare fitted means at clear values, and describe whether the increase or decrease becomes steeper or flatter. Restrict substantive interpretation to predictor values supported by the data; a quadratic curve can bend sharply outside that range, where its shape may be unreliable.

  • Common mistake: “The coefficient of \(x\) is 6, so the fitted outcome rises by 6 units for every one-unit increase in \(x\).” This treats the linear coefficient as a constant slope.
  • Correction: In a quadratic model the slope at \(x\) is \(\hat{\beta}_1+2\hat{\beta}_2x\), and the finite change between two selected values is \((x_2-x_1)[\hat{\beta}_1+\hat{\beta}_2(x_1+x_2)]\). State the interval and calculate its fitted means or difference.
  • Another check: Verify that a turning point falls within the observed range before describing it as a feature of the observed relationship.
Key takeaway: Evaluate a quadratic fitted mean by substituting \(x\) and \(x^2\) into the entire fitted equation. The quadratic term makes predicted changes depend on predictor location, so a coefficient alone cannot describe the change over every interval.

Check Your Understanding

Use the fitted equation \(\hat{\mu}(x)=10+4x-0.5x^2\), with \(x\) measured in hours and observed values from 0 to 8 hours.

  1. Calculate the fitted means at 2 and 4 hours, showing the substitution and arithmetic.
  2. What is the fitted change from 2 to 4 hours, and what are its units?
  3. Find the local slope at 2 hours and at 6 hours. How does its change reflect the sign of the quadratic coefficient?
  4. Find the curve’s turning point and determine whether it is a maximum or a minimum.
  5. Explain why the coefficient 4 does not mean the fitted mean increases by 4 outcome units for every additional hour.