Sub topic 11
Model misspecification: omitted variables, functional form, scaling and data pooling
This chapter assumes you can read multiple regression output and run t-tests and F-tests on coefficients. It also assumes you know the symptoms of heteroskedasticity, serial correlation and multicollinearity from the earlier chapters. Here we step back and ask a broader question: is the model itself built correctly?
A model is misspecified when its form does not match the process that generated the data. The usual consequences are biased and inconsistent coefficient estimates, invalid standard errors, or both. Unlike heteroskedasticity, a misspecification error often cannot be repaired by changing only the standard errors. The model has to be rebuilt.
The map of misspecification errors
The CFA Level II curriculum groups misspecification into three families. Learn the families, because exam questions often ask you to classify a described mistake.
| Family | Typical error | Main consequence |
|---|---|---|
| Incorrect functional form | Omitted variable, wrong transformation, pooling unlike data | Biased and inconsistent coefficients |
| Correlation of an independent variable with the error term | Lagged dependent variable with serial correlation, measurement error, simultaneity | Biased and inconsistent coefficients |
| Other time-series misspecification | Nonstationary series, nonindependent errors | Invalid inference |
This chapter covers the first family in detail and introduces the second. Nonstationarity belongs to time-series analysis.
Omitted variables
An omitted variable is a relevant explanatory variable that is left out of the model. If the omitted variable is correlated with an included variable, the included variable's coefficient absorbs part of the omitted variable's effect. This is omitted variable bias.
Suppose the true model is
Y = b0 + b1 X1 + b2 X2 + e
and you estimate Y = b0 + b1 X1 + e instead. The estimated slope on X1 converges to b1 plus b2 times the slope from regressing X2 on X1. The direction of the bias follows the product of two signs: the sign of b2 and the sign of the correlation between X1 and X2.
- If both signs are the same, the bias is upward.
- If the signs differ, the bias is downward.
- If X2 is uncorrelated with X1, the slope on X1 is unbiased, though the error variance and standard errors are still distorted.
The next code block simulates this. It fits the correct model and the model with X2 omitted, so you can see the slope on x1 drift from its true value of 2.
import numpy as np
import statsmodels.api as sm
rng = np.random.default_rng(7)
n = 5000
x1 = rng.normal(size=n)
x2 = 0.7 * x1 + rng.normal(scale=0.7, size=n) # correlated with x1
y = 1.0 + 2.0 * x1 + 3.0 * x2 + rng.normal(size=n)
full = sm.OLS(y, sm.add_constant(np.column_stack([x1, x2]))).fit()
short = sm.OLS(y, sm.add_constant(x1)).fit()
print("Full model slopes: ", full.params[1:])
print("Omitted-x2 slope: ", short.params[1])Here b2 = 3 is positive and the correlation between x1 and x2 is positive, so the short model overstates the slope on x1. It lands near 2 + 3 × 0.7 ≈ 4.1, roughly double the true value.
Detecting and fixing omission
You rarely know which variable is missing, so detection relies on judgment and indirect evidence.
- Economic theory or prior research names a variable that your model lacks.
- Residual plots show a systematic pattern, such as residuals that trend with an excluded candidate variable.
- Adding a candidate variable changes the other coefficients a lot. Stable coefficients suggest little omission bias.
The remedy is to add the variable. Be careful about the opposite error: including irrelevant variables does not bias the coefficients, but it lowers precision. It consumes degrees of freedom and, if the extra variable is correlated with the others, inflates standard errors. Omitting a relevant variable causes bias. Including an irrelevant one causes inefficiency. Bias is usually the worse problem.
Incorrect functional form
Functional form is the shape of the relationship you impose, such as linear, logarithmic or quadratic. OLS is linear in the parameters, but variables can be transformed first. Misspecified form arises in three common ways.
Omitted nonlinearity and transformations
If the true relationship is curved and you fit a straight line, the residuals show a pattern. They are positive at both ends of x and negative in the middle, or the reverse. This violates the assumption that the errors have zero conditional mean, so the coefficients are biased.
Common fixes:
- Log transformation. Use ln(Y) when changes are proportional. A coefficient of 0.04 on X then means Y rises about 4% per unit of X. A log-log model gives elasticities directly.
- Polynomial terms. Add X squared when the effect rises and then falls, or the reverse.
- Interaction terms. Add X1 × X2 when the effect of one variable depends on the level of another.
import numpy as np
import statsmodels.api as sm
rng = np.random.default_rng(3)
n = 400
x = rng.uniform(1, 10, size=n)
y = 2.0 + 1.5 * x - 0.12 * x**2 + rng.normal(scale=0.5, size=n)
linear = sm.OLS(y, sm.add_constant(x)).fit()
quad = sm.OLS(y, sm.add_constant(np.column_stack([x, x**2]))).fit()
print("Linear R2: ", round(linear.rsquared, 3))
print("Quadratic R2:", round(quad.rsquared, 3))
print("Quadratic coefficients:", quad.params.round(3))With an interaction or polynomial term, a single slope no longer describes the effect of X. The effect of X depends on the other variable, or on X itself, so always report the marginal effect at stated values.
Improper scaling of variables
Variables measured on very different scales can cause trouble. One variable may be in dollars and another in billions of dollars. Also, a regression of levels on levels may be inappropriate when changes or ratios are the economically meaningful quantity.
Rescaling a variable by a constant, for example dollars to thousands of dollars, changes the coefficient and its standard error by the same factor. The t-statistic, R-squared and p-value do not change. So rescaling by itself does not harm inference, but it affects readability and, with extreme ranges, numerical stability.
The more serious scaling errors are:
- Using raw amounts when the relationship is proportional. Large firms then dominate the fit, which often produces heteroskedasticity. Scaling by size, such as using returns, margins or per-share figures, or taking logs, often fixes this.
- Mixing units inside a ratio or using a variable with inconsistent definitions across observations.
- Comparing coefficient magnitudes across variables measured in different units. A larger raw coefficient does not mean a more important variable. Standardizing each variable to mean zero and standard deviation one allows that comparison.
Improper data pooling
Pooling means combining observations from different groups, periods or regimes into one regression. It is improper when the groups follow different relationships, so one set of coefficients cannot describe them all.
Imagine regressing stock returns on a valuation factor across two market regimes. In calm markets the slope is 0.5 and in crisis periods it is 1.5. A pooled regression estimates something near an average that is wrong for both regimes. Pooling can even reverse the sign of a slope, a case of Simpson's paradox, when group intercepts differ and the groups are unevenly mixed along x.
Warning signs are residuals that cluster by group and a pooled fit that looks poor for each subgroup. Two remedies exist:
- Estimate separate regressions for each group.
- Keep one regression and add dummy variables for group intercepts, plus interaction terms to let slopes differ.
You can test whether pooling is acceptable with an F-test of the restriction that the interaction and group dummy coefficients are all zero. This applies the joint test from the F-test chapter.
import numpy as np
import statsmodels.api as sm
rng = np.random.default_rng(11)
n = 300
x = rng.normal(size=2 * n)
g = np.r_[np.zeros(n), np.ones(n)] # 0 = calm, 1 = crisis
y = 0.5 * x + g * (1.0 * x) + rng.normal(scale=0.5, size=2 * n)
pooled = sm.OLS(y, sm.add_constant(x)).fit()
X_full = sm.add_constant(np.column_stack([x, g, g * x]))
full = sm.OLS(y, X_full).fit()
f_stat, p_value, df_diff = full.compare_f_test(pooled)
print("Pooled slope:", round(pooled.params[1], 3))
print("Calm slope: ", round(full.params[1], 3))
print("Crisis slope:", round(full.params[1] + full.params[3], 3))
print("F-test of pooling restriction, p-value:", p_value)A small p-value rejects the restriction, so pooling is improper. The pooled slope sits between the two regime slopes and describes neither.
Regressors correlated with the error term
The second family is more serious, because OLS then fails even in large samples. The Gauss-Markov setup requires each regressor to be uncorrelated with the error term. When it is not, the estimators are biased and inconsistent. Three typical sources appear in the curriculum.
- Lagged dependent variable with serial correlation. If Y at time t depends on Y at time t-1, and the errors are serially correlated, the lagged Y is correlated with the current error. Here the Durbin-Watson test is also unreliable, so use Breusch-Godfrey.
- Measurement error. If an independent variable is measured with noise, such as a proxy for expected inflation, the observed value is correlated with the error. This biases the slope toward zero, an effect called attenuation.
- Simultaneity. If Y and X affect each other, such as price and quantity in a market, X is correlated with the error term. A single OLS equation cannot separate the two directions.
The standard remedy is instrumental variables or two-stage least squares, where you replace the problem regressor with a variable that is correlated with it but not with the error. The curriculum expects you to recognize these cases and their consequences, not to run the estimator.
Choosing among diagnostics
Misspecification symptoms overlap, so work through a sequence.
- Plot residuals against fitted values and each regressor. Curvature suggests functional form. Fanning suggests heteroskedasticity.
- Check whether residuals cluster by group, period or regime.
- Ask whether theory demands a variable you left out.
- If a lagged dependent variable is present, test for serial correlation with Breusch-Godfrey.
- Re-estimate with the proposed correction, then compare AIC and BIC against the original model.
Summary of consequences
| Error | Coefficients | Standard errors |
|---|---|---|
| Omitted correlated variable | Biased, inconsistent | Unreliable |
| Irrelevant variable included | Unbiased | Larger than needed |
| Wrong functional form | Biased, inconsistent | Unreliable |
| Improper pooling | Biased for each group | Unreliable |
| Rescaling by a constant | Rescaled, inference unchanged | Rescaled |
| Regressor correlated with error | Biased, inconsistent | Unreliable |
Exercise
An analyst regresses a fund's return on its market beta exposure and omits a value-factor variable. The value factor has a positive true coefficient and is negatively correlated with the market exposure variable. In which direction is the estimated market coefficient biased, and does a larger sample fix it?
Show answer
The bias is downward, because the true coefficient on the omitted variable is positive and its correlation with the included variable is negative, so the signs differ. A larger sample does not fix it, since omitted variable bias makes the estimator inconsistent. The fix is to add the value factor to the model.
Exercise
A regression of company profit on revenue, using both small and large firms in dollars, shows residuals that fan out as revenue increases. Name one scaling or functional-form change that could address the problem at its source, and say why it helps.
Show answer
Take logs of both variables, or use a profit margin on a ratio basis instead of raw dollars. Raw dollar amounts let large firms dominate and give the errors a variance that grows with firm size. Logs or ratios put firms on a comparable proportional scale, which reduces the fanning.
Exercise
A regression on 20 years of data combines a low-volatility regime and a high-volatility regime, and the F-test on the group dummy and interaction terms has a p-value of 0.003. What do you conclude about pooling, and what do you do?
Show answer
Reject the restriction that the group dummy and interaction coefficients are zero. The two regimes follow different relationships, so pooling is improper. Estimate separate regressions per regime, or keep one regression with the group dummy and interaction terms.