Centering Nonlinear Terms: Interpreting Marginal Effects at the Mean

In empirical macroeconomics, finance, and firm-level studies, nonlinear terms are often introduced to capture relationships that are not constant across the distribution of a variable. For example, the effect of firm age, leverage, inflation, or financial development may depend on the initial level of that variable.

This creates an important interpretation issue. Once we include squared terms or interaction terms in a regression, the coefficient on the linear term is no longer automatically the marginal effect of that variable. The marginal effect depends on the value at which it is evaluated.

This is why researchers often center nonlinear terms around the sample mean. In practice, this means subtracting the mean before constructing squared terms or interaction terms.

The basic problem

Consider the following model:

$$ y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2 + u_i $$

At first sight, one might be tempted to interpret \( \beta_1 \) as the effect of \( x_i \) on \( y_i \). But this is not correct because the model is nonlinear in \( x_i \).

The marginal effect of \( x_i \) is:

$$ \frac{\partial y_i}{\partial x_i} = \beta_1 + 2\beta_2 x_i $$

Therefore, the effect of \( x_i \) depends on the level of \( x_i \). In this specification, \( \beta_1 \) is the marginal effect of \( x_i \) only when:

$$ x_i = 0 $$

This may not be economically meaningful. For many macroeconomic or financial variables, zero may be outside the relevant range of the data. For example, a value of zero for log GDP per capita, firm age, or leverage may not represent a useful benchmark.

Centering the nonlinear term

Now suppose we write the model as:

$$ y_i = \alpha_0 + \alpha_1 x_i + \alpha_2(x_i-\bar{x})^2 + u_i $$

where \( \bar{x} \) is the sample mean of \( x_i \).

The marginal effect of \( x_i \) is now:

$$ \frac{\partial y_i}{\partial x_i} = \alpha_1 + 2\alpha_2(x_i-\bar{x}) $$

At the mean of \( x_i \), we have:

$$ x_i = \bar{x} $$

Therefore:

$$ \begin{aligned} \frac{\partial y_i}{\partial x_i} &= \alpha_1 + 2\alpha_2(\bar{x}-\bar{x}) \\ &= \alpha_1 \end{aligned} $$

So, after centering the squared term, the coefficient on the linear variable is the marginal effect evaluated at the mean of the variable.

What does “removing the mean” mean?

When a presenter says that the mean is removed from nonlinear terms, they usually mean that the variable is centered before constructing nonlinear terms.

Instead of using:

$$ x_i^2 $$

we use:

$$ (x_i-\bar{x})^2 $$

Similarly, instead of using an interaction term such as:

$$ x_i z_i $$

we use:

$$ (x_i-\bar{x})(z_i-\bar{z}) $$

This does not remove the variable from the model. It only expresses nonlinear terms as deviations from their sample means.

The advantage is interpretational. At the mean, these deviations are equal to zero. This makes the coefficient on the linear term directly interpretable as a marginal effect at the mean.

Example with an interaction term

Consider a model with an interaction:

$$ \begin{aligned} y_i = &\beta_0 + \beta_1 x_i + \beta_2 z_i \\ &+ \beta_3(x_i-\bar{x})(z_i-\bar{z}) + u_i \end{aligned} $$

The marginal effect of \( x_i \) is:

$$ \frac{\partial y_i}{\partial x_i} = \beta_1 + \beta_3(z_i-\bar{z}) $$

At the mean of \( z_i \), where \( z_i = \bar{z} \), this becomes:

$$ \frac{\partial y_i}{\partial x_i} = \beta_1 $$

Therefore, \( \beta_1 \) is the marginal effect of \( x_i \) when \( z_i \) is at its mean.

Similarly, the marginal effect of \( z_i \) is:

$$ \frac{\partial y_i}{\partial z_i} = \beta_2 + \beta_3(x_i-\bar{x}) $$

At the mean of \( x_i \), this becomes:

$$ \frac{\partial y_i}{\partial z_i} = \beta_2 $$

Centering therefore makes interaction models much easier to interpret.

Application to macroeconomic and firm-level models

Suppose a researcher estimates a model where the dependent variable is a conditional quantile of firm growth, investment, productivity, or financial fragility:

$$ \begin{aligned} Q_y(\tau) = &\delta_0(\tau) + \delta_1(\tau)\log(age_{it}) + \delta_2(\tau)\left[\log(age_{it})-c_a\right]^2 \\ &+ \delta_3(\tau)leverage_{i,t-1} + \delta_4(\tau)\left[leverage_{i,t-1}-c_l\right]^2 \\ &+ \delta_5(\tau) \left[\log(age_{it})-c_a\right] \left[leverage_{i,t-1}-c_l\right] + \cdots \end{aligned} $$

Here, \( c_a \) is the mean of \( \log(age_{it}) \), and \( c_l \) is the mean of \( leverage_{i,t-1} \):

$$ c_a = \overline{\log(age)} $$
$$ c_l = \overline{leverage} $$

The marginal effect of log age is:

$$ \begin{aligned} \frac{\partial Q_y(\tau)}{\partial \log(age_{it})} = &\delta_1(\tau) + 2\delta_2(\tau)\left[\log(age_{it})-c_a\right] \\ &+ \delta_5(\tau)\left[leverage_{i,t-1}-c_l\right] \end{aligned} $$

At the mean of log age and leverage, we have:

$$ \log(age_{it}) = c_a $$

and:

$$ leverage_{i,t-1} = c_l $$

Therefore, the centered terms become zero, and the marginal effect simplifies to:

$$ \frac{\partial Q_y(\tau)}{\partial \log(age_{it})} = \delta_1(\tau) $$

This means that \( \delta_1(\tau) \) is the marginal effect of log age at the mean of log age and leverage.

The same logic applies to leverage. Its marginal effect is:

$$ \begin{aligned} \frac{\partial Q_y(\tau)}{\partial leverage_{i,t-1}} = &\delta_3(\tau) + 2\delta_4(\tau)\left[leverage_{i,t-1}-c_l\right] \\ &+ \delta_5(\tau)\left[\log(age_{it})-c_a\right] \end{aligned} $$

At the mean, this becomes:

$$ \frac{\partial Q_y(\tau)}{\partial leverage_{i,t-1}} = \delta_3(\tau) $$

So \( \delta_3(\tau) \) is the marginal effect of leverage at the mean of the relevant variables.

Economic intuition

The intuition is simple. When nonlinear terms are expressed as deviations from the mean, these terms vanish at the average observation.

At the mean:

$$ x_i-\bar{x}=0 $$

and:

$$ z_i-\bar{z}=0 $$

Therefore, squared deviations and centered interaction terms do not contribute to the marginal effect at the mean. The marginal effect is then given directly by the coefficient on the corresponding linear variable.

This is especially useful in empirical macroeconomics because models often include several nonlinear terms. Without centering, the marginal effect at the mean would be a combination of several coefficients. With centering, the interpretation becomes more transparent.

A Stata implementation

In Stata, one can center variables before generating squared and interaction terms:

summarize x
gen x_c = x - r(mean)
gen x_c_sq = x_c^2

summarize z
gen z_c = z - r(mean)
gen z_c_sq = z_c^2

gen xz_c = x_c*z_c

reg y x z x_c_sq z_c_sq xz_c controls

In this specification, the coefficient on x is the marginal effect of \( x \) when \( x \) and \( z \) are at their sample means. The coefficient on z is the marginal effect of \( z \) when \( x \) and \( z \) are at their sample means.

The estimator may change across applications. The same logic applies in ordinary least squares, panel data models, and quantile regressions. What matters is the way the nonlinear terms are constructed and how the derivative is evaluated.

Conclusion

Centering nonlinear terms is a simple but powerful way to improve the interpretation of regression coefficients.

When squared terms and interaction terms are written as deviations from the mean, the coefficients on the linear variables become marginal effects evaluated at the mean of the relevant variables.

The model remains nonlinear. The effect of a variable can still depend on the level of that variable or on the level of another interacting variable. But centering gives the linear coefficients a clear and useful benchmark interpretation.

The key idea is:

$$ \text{Centering nonlinear terms makes the linear coefficients interpretable as marginal effects at the mean.} $$

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.