Tutorials › Regression Analysis (Undergraduate) › Polynomial Mean Functions and Basis Terms

Polynomial Regression · Tutorial 419 of 991

Polynomial Mean Functions and Basis Terms

See how a polynomial mean function combines powers of a predictor into one fitted curve, and learn to interpret its terms without treating them as separate models.

Intermediate 9 min read

What You'll Learn

  • Define a polynomial regression mean function using powers of a quantitative predictor.
  • Distinguish the predictor’s power terms from transformations of the outcome.
  • Explain how the intercept and power terms combine to determine a fitted value.
  • Interpret the units of polynomial coefficients.
  • Calculate fitted values from a polynomial mean function and identify common interpretation errors.

Introduction

A straight-line regression mean changes at a constant rate as its predictor changes. Some relationships are not well described by a straight line: the mean response may bend across the range of observed predictor values. One way to represent such a pattern is to include powers of the predictor in the mean function.

A polynomial regression mean function is a single expression made by adding an intercept and one or more power terms. Each term contributes to the predicted mean at a given predictor value; the curve comes from their combined values, not from any one term acting alone. This tutorial develops that representation and shows how to calculate and interpret its fitted values.

Polynomial Mean Functions and Basis Terms

Definition: A polynomial regression mean function of degree \(d\) for a quantitative predictor \(x\) has the form $$ E(Y\mid X=x)=m(x)=\beta_0+\beta_1x+\beta_2x^2+\cdots+\beta_dx^d. $$ Here \(Y\) is the response, \(X\) is the predictor, and \(\beta_0,\ldots,\beta_d\) are coefficients. The powers \(1,x,x^2,\ldots,x^d\) are the basis terms used to express the mean function. The degree is the highest power with a nonzero coefficient.

The basis terms are functions of the same predictor. For example, if \(x=3\), then \(x^2=9\) and \(x^3=27\). They are not separate predictors measured independently of \(x\); their values are determined by the value of \(x\). The model combines these values with their respective coefficients to produce one conditional mean.

The intercept is the constant term \(\beta_0\). Since all positive powers of \(x\) equal zero when \(x=0\), the mean function gives \(m(0)=\beta_0\). This is an interpretation at \(x=0\), whether or not zero lies in the observed range. When zero is outside that range, the intercept is still part of the mathematical expression, but its value may not describe a practically observed situation.

Each coefficient multiplies one basis term. The term \(\beta_jx^j\) contributes \(\beta_jx^j\) to the mean at the specified value of \(x\). In general, a coefficient on a power term is not the entire change in the mean associated with a one-unit increase in \(x\). The fitted mean at any \(x\) is the sum of all the terms, including the intercept.

Mean Model and Fitted Curve

The mean function describes the average response at each predictor value, not every individual response. A standard way to express the regression model is

$$ Y_i=m(x_i)+\varepsilon_i,\qquad E(\varepsilon_i\mid x_i)=0. $$

Here \(x_i\) is the predictor value for observation \(i\), and \(\varepsilon_i\) is that observation’s deviation from the mean function. The zero conditional-mean assumption ensures that \(E(Y_i\mid x_i)=m(x_i)\). This definition of the mean function does not, by itself, require normally distributed errors or constant error variance. Those conditions matter for particular estimation and inference procedures, not for defining the polynomial form.

In data analysis the coefficients are usually estimated. Write the estimated coefficients as \(\hat{\beta}_0,\hat{\beta}_1,\ldots,\hat{\beta}_d\). The resulting fitted mean function is

$$ \hat{m}(x)=\hat{\beta}_0+\hat{\beta}_1x+\hat{\beta}_2x^2+\cdots+\hat{\beta}_dx^d. $$

For a specified \(x\), substituting its value into every term and adding gives the fitted mean response \(\hat{m}(x)\). Evaluating this expression at many predictor values produces the fitted curve. In a plot, the curve is the combined result of all the terms across those values. A power term is not a separate curve to interpret in isolation.

Worked Example: Combining an Intercept and a Squared Term

Suppose a hypothetical model relates \(Y\), a score in points, to \(x\), years since a program began: $$ m(x)=12+3x-0.5x^2. $$ Calculate the mean-function value at \(x=2\) years and identify the contribution of each term.

At \(x=2\), the constant term contributes 12 points, the \(x\) term contributes \(3(2)=6\) points, and the \(x^2\) term contributes \(-0.5(2^2)=-2\) points. Therefore, $$ m(2)=12+3(2)-0.5(2^2)=12+6-2=16. $$ The model’s mean response at two years is 16 points.

The intercept is the model’s mean at \(x=0\): \(m(0)=12\) points. At \(x=2\), the fitted mean is not the intercept plus only the linear contribution; it includes the negative contribution from the squared term as well. The coefficients have units that make each term a score: 12 points, 3 points per year, and \(-0.5\) points per year squared.

Why the Terms Form One Curve

A polynomial mean function is a sum of basis terms. Its shape is determined by how the value of each term changes as \(x\) changes, and by how the coefficients weight those terms. The following algebraic form makes the combination explicit:

$$ m(x)=\sum_{j=0}^{d}\beta_jx^j. $$

At any fixed \(x\), the values \(1,x,x^2,\ldots,x^d\) are numbers. The expression multiplies each of those numbers by its coefficient and adds the results. As \(x\) varies, the basis-term values vary, so the sum traces out a curve. This is why a polynomial model can represent a mean pattern more flexible than a straight line, while still specifying one mean at each predictor value.

The model is linear in its coefficients: each coefficient appears as a multiplier and the terms are added together. But when a power higher than one is included, the mean function is generally not a straight-line function of \(x\). These two descriptions are compatible because “linear in the coefficients” concerns how the unknown coefficients enter the expression, while “straight-line” concerns how the mean changes with the predictor.

This representation can also be written using basis functions \(\phi_j(x)=x^j\), so that \(m(x)=\sum_{j=0}^{d}\beta_j\phi_j(x)\). The basis-function notation emphasizes that the model is built from chosen functions of one predictor. In polynomial regression, those functions are powers. It does not mean that \(x^2\) or \(x^3\) is a newly observed outcome, and it does not transform \(Y\).

Worked Example: Adding a Cubic Basis Term

Consider a hypothetical mean function for response \(Y\), measured in response units, with \(x\) measured in tens of milligrams: $$ m(x)=5+2x-0.4x^2+0.05x^3. $$ Calculate the fitted mean at \(x=2\), and show how the terms combine.

The basis-term values at \(x=2\) are \(1\), \(2\), \(2^2=4\), and \(2^3=8\). Their weighted contributions are \(5\), \(2(2)=4\), \(-0.4(4)=-1.6\), and \(0.05(8)=0.4\), respectively. Thus, $$ m(2)=5+2(2)-0.4(2^2)+0.05(2^3) =5+4-1.6+0.4=7.8. $$

The model’s mean response at \(x=2\), or 20 milligrams on the stated scale, is 7.8 response units. The cubic term contributes 0.4 response units at this particular \(x\); it does not by itself give the fitted mean. Because \(x\) is measured in tens of milligrams, the coefficient on \(x^3\) has units of response units per cubed ten-milligram unit, so that its product with \(x^3\) is in response units.

Degrees, Units, and the Predictor Scale

A model with \(d=1\) uses the constant and first power of \(x\); it is a straight-line mean function. Including higher powers allows additional terms in the function. The degree describes the highest power included with a nonzero coefficient. If a coefficient on the highest listed power is zero, the expression has a lower degree than its written maximum power.

Units help check whether a polynomial expression is being used consistently. If \(Y\) is measured in kilograms and \(x\) in meters, then the coefficient of \(x^j\) must have units of kilograms per meter to the \(j\)th power. Consequently, \(\beta_jx^j\) has units of kilograms, matching the response and every other term in the sum. The intercept has the units of \(Y\).

Changing the numerical units of \(x\) changes the numerical values of its powers and therefore changes the coefficients needed to express the same mean pattern. For instance, measuring a distance in centimeters rather than meters changes the numerical predictor value by a factor of 100. The polynomial terms must be interpreted with the predictor’s stated scale. A coefficient cannot be interpreted meaningfully without knowing the units used for \(x\) and \(Y\).

Worked Example: Evaluating a Mean Function at Several Values

A hypothetical model predicts a laboratory measurement \(Y\), in units, from a quantitative setting \(x\), in setting units: $$ m(x)=8+1.2x+0.3x^2. $$ Find the mean-function values at \(x=0\), \(x=1\), and \(x=3\).

At \(x=0\), both power terms are zero, so $$ m(0)=8+1.2(0)+0.3(0^2)=8. $$ At \(x=1\), $$ m(1)=8+1.2(1)+0.3(1^2)=8+1.2+0.3=9.5. $$ At \(x=3\), $$ m(3)=8+1.2(3)+0.3(3^2)=8+3.6+2.7=14.3. $$

These are three values from one mean function: 8 units at setting 0, 9.5 units at setting 1, and 14.3 units at setting 3. Each value includes the intercept and both power-term contributions. Listing several evaluations helps show how the combined function—not any one coefficient—determines the mean at each predictor value.

Common Mistakes and Why the Representation Matters

A frequent mistake is to interpret a coefficient as though it described the whole fitted curve. In a polynomial model, the coefficient \(\beta_j\) weights the particular basis term \(x^j\). At a specific predictor value, the term’s contribution is \(\beta_jx^j\), and the fitted mean is the sum of that contribution and all the others. A coefficient alone is not the model’s prediction at that \(x\).

Another mistake is to treat powers as independently observed predictors. The values \(x\) and \(x^2\) are linked because the second is calculated from the first. They are terms in a chosen mathematical representation, not separate measurements. Similarly, including \(x^2\) changes the mean function for \(Y\); it does not mean that the outcome itself has been squared.

The intercept also requires care. It is exactly the mean function’s value at \(x=0\), but that may be an extrapolation if the observed predictor values are all far from zero. The algebraic meaning is fixed; whether it has a useful interpretation in a particular setting depends on the predictor scale and observed range.

Polynomial terms provide a way to describe curved mean patterns using a sum of familiar functions. This is useful because the fitted mean can be evaluated at specific predictor values and displayed as a curve. The representation alone does not establish that a particular polynomial is appropriate for every data set; it defines the form of the mean function, while evaluating its suitability requires attention to the data and the purpose of the analysis.

Key takeaway: A polynomial regression mean is one sum: an intercept plus coefficients multiplied by powers of a quantitative predictor. At every predictor value, evaluate all basis terms and add their contributions to obtain the fitted mean.

Check Your Understanding

Answer each question by referring to the basis terms and their combined contribution.

  1. For \(m(x)=4-2x+0.5x^2\), identify the degree and list the basis terms.
  2. Using the same function, calculate \(m(2)\) and show the contribution of each term.
  3. In a polynomial mean function, what does the intercept represent? Why might that interpretation be practically limited?
  4. Explain the difference between being linear in the coefficients and being a straight-line function of the predictor.
  5. If \(Y\) is measured in liters and \(x\) in hours, what are the units of the coefficient multiplying \(x^2\)?