Sub topic 17
Assumptions, violations, and limitations of regression
This chapter assumes you can estimate a simple regression by ordinary least squares (OLS), read R-squared and the standard error of estimate, and run a t-test on a slope. The question here is when those results can be trusted.
Why the assumptions matter
The slope estimate is a number you compute from a sample. The t-test, the confidence interval, and the prediction interval all rely on the sampling distribution of that estimate. That distribution is only valid if the model's assumptions hold. When they fail, the slope may still be a reasonable estimate, but the standard error, the t-statistic, and the p-value can be wrong. A "significant" slope can then be an artifact.
The CFA curriculum lists these assumptions for simple linear regression:
- Linearity. The relationship between the dependent variable Y and the independent variable X is linear in the parameters.
- Homoskedasticity. The variance of the error term is the same for all observations.
- Independence. Observations, and therefore errors, are not correlated with each other.
- Normality. The error term is normally distributed.
- Independent variable not random. X is uncorrelated with the error term. The curriculum states this as X being fixed or at least uncorrelated with the errors.
The model behind them is Yi = b0 + b1·Xi + ei, where ei is the error (residual) for observation i.
Checking assumptions with residuals
A residual is the observed Y minus the fitted Y. Most diagnostics start with a plot of residuals against X or against the fitted values.
| What the plot shows | Likely problem |
|---|---|
| Random scatter around zero with constant spread | No obvious violation |
| A curve, such as a U shape | Nonlinearity |
| Spread that widens or narrows with X | Heteroskedasticity |
| Runs of positive residuals followed by runs of negative ones | Serial correlation |
| A few points far from the rest | Outliers |
Normality is checked separately with a histogram or Q-Q plot of the residuals. With a large sample, moderate non-normality matters little for inference on the slope.
Heteroskedasticity
Heteroskedasticity means the variance of the errors changes across observations. A common case is a regression of company spending on company size. Large companies show a much wider spread of outcomes than small ones.
- Effect on estimates. The OLS slope and intercept remain unbiased.
- Effect on inference. The usual standard errors are unreliable. With a typical pattern, they are too small, so t-statistics are too large and you reject the null too often (Type I errors rise). The F-test is also unreliable.
- Detection. Inspect residual plots, or use a formal test such as the Breusch-Pagan test.
- Correction. Use heteroskedasticity-robust (White) standard errors. Respecifying the variables, for example with logs, can also help.
Serial correlation
Serial correlation (autocorrelation) means errors in one period are related to errors in other periods. It is mainly a concern for time-series data. With positive serial correlation, a positive error tends to be followed by another positive error.
- Effect on estimates. In simple regression with a non-lagged independent variable, the slope stays unbiased.
- Effect on inference. With positive serial correlation, standard errors are typically too small. The t-statistics are inflated and you again reject too often.
- Detection. Plot residuals over time, or use the Durbin-Watson test.
- Correction. Use standard errors that are robust to serial correlation, such as Newey-West.
Outliers and influential points
An outlier is an observation far from the others. It can be extreme in Y, in X, or both. A point with an extreme X value has high leverage and can pull the fitted line toward itself. A point that changes the fitted line a lot when removed is called influential.
Do not delete a point only because it is inconvenient. First check whether it is a data error. If it is a real observation, report results with and without it and explain the difference.
Violations at a glance
| Violation | Slope estimate | Standard error | Typical consequence |
|---|---|---|---|
| Heteroskedasticity | Unbiased | Unreliable, often too small | Inflated t-statistics |
| Serial correlation (positive) | Unbiased in simple regression | Usually too small | Inflated t-statistics |
| Nonlinearity | Biased as a description of the relationship | Not meaningful | Poor fit and poor forecasts |
| Non-normal errors | Unbiased | Valid in large samples | Small-sample tests may be off |
Seeing the problem in code
The following script builds data whose error spread grows with X. It then compares the usual standard error of the slope with a robust one. It uses only numpy.
import numpy as np
rng = np.random.default_rng(42)
n = 200
x = rng.uniform(1, 10, n)
errors = rng.normal(0, 0.5 * x) # spread grows with x
y = 2.0 + 1.5 * x + errors
X = np.column_stack([np.ones(n), x])
beta = np.linalg.solve(X.T @ X, X.T @ y)
resid = y - X @ beta
xtx_inv = np.linalg.inv(X.T @ X)
# Classical standard errors assume constant error variance
sigma2 = resid @ resid / (n - 2)
se_classical = np.sqrt(np.diag(sigma2 * xtx_inv))
# White (HC0) robust standard errors
meat = X.T @ (X * (resid ** 2)[:, None])
se_robust = np.sqrt(np.diag(xtx_inv @ meat @ xtx_inv))
print("slope:", beta[1])
print("classical SE:", se_classical[1])
print("robust SE: ", se_robust[1])
print("classical t: ", beta[1] / se_classical[1])
print("robust t: ", beta[1] / se_robust[1])The slope estimate is the same under both approaches. Only the standard error, and so the t-statistic, changes. In this setup the two standard errors differ because the error variance is not constant. How large the gap is depends on the random draw.
Limitations of regression analysis
Even a well-specified model has limits.
- Parameter instability. A relationship estimated in one period may not hold in another. A beta estimated during a calm market may fail during a crisis.
- Public knowledge. If a pattern becomes widely known, investors may trade on it and remove it.
- Assumption violations. Heteroskedasticity or serial correlation can make the tests misleading, as shown above.
- Correlation is not causation. A significant slope shows an association. It does not show that X causes Y. A third variable can drive both.
- Extrapolation. Predictions outside the range of observed X values rely on an unverified assumption that the line continues.
- Spurious results. If you test many variables, some will look significant by chance alone.
Exercises
Exercise
A regression of a firm's annual expenses on its revenue shows residuals that fan out as revenue grows. Name the violation, say whether the slope estimate is biased, and describe the effect on the t-test of the slope.
Show answer
The violation is heteroskedasticity. The slope estimate remains unbiased. The usual standard error is unreliable and typically too small, so the t-statistic is too large and the test rejects a true null too often. Use robust (White) standard errors.
Exercise
A time-series regression of monthly fund returns on a market index has residuals that show long runs of positive values and then long runs of negative values. Which violation is likely, which test could detect it, and what is the consequence for inference?
Show answer
Positive serial correlation is likely. The Durbin-Watson test can detect it. The slope stays unbiased in simple regression, but the standard errors are typically too small. The t-statistics are inflated, so you may wrongly conclude the slope is significant. Use serial-correlation-robust standard errors such as Newey-West.
Exercise
An analyst fits a line using X values between 1 and 10 and then predicts Y at X = 40. State the limitation and why it matters.
Show answer
This is extrapolation outside the sample range. The regression gives no evidence that the linear relationship holds at X = 40, so the prediction may be badly wrong. Its prediction interval also understates the real uncertainty because the interval assumes the model holds.