Sub topic 17
Assumptions, Violations, and Limitations of Regression
What regression assumes
Assume you know means, variances, standard deviations, normal distributions, and the algebra of a straight line. You should also understand that a sample estimates an unknown population relationship.
The simple linear regression model is:
ŷᵢ = b₀ + b₁xᵢ + eᵢ
Here, ŷᵢ is the predicted value, b₀ is the intercept, b₁ is the slope, and eᵢ is the error. For valid inference about b₁, the errors should meet several conditions.
- Linearity: the average relationship between x and y is a straight line.
- Independence: one observation's error does not depend on another observation's error.
- Constant variance: the errors have roughly the same spread for all values of x. This is called homoskedasticity.
- Normality: the errors are approximately normally distributed, especially in small samples.
- No extreme influence: one unusual observation should not determine the estimated line.
- Exogeneity: the explanatory variable is not related to unobserved factors in the error term.
The model describes conditional averages. It does not automatically prove that changes in x cause changes in y.
Recognizing violations
| Pattern in residuals | Likely problem | Possible response |
|---|---|---|
| Curve or systematic shape | Nonlinearity | Add a transformed or nonlinear term |
| Funnel shape | Unequal variance | Transform variables or use robust methods |
| Long runs above or below zero | Dependent errors | Model time or cluster dependence |
| One distant point changes the line | Influential observation | Check the data and investigate the observation |
A residual is the actual value minus the fitted value:
eᵢ = yᵢ − ŷᵢ
Plot residuals against fitted values and against x. A valid model should show a roughly random cloud around zero. A curve suggests that a straight line misses the functional form. A funnel suggests changing variance. In time-series data, residuals that move in runs suggest dependence.
import numpy as np
x = np.array([1, 2, 3, 4, 5, 6], dtype=float)
y = np.array([2.0, 2.8, 4.1, 6.2, 8.9, 12.5])
slope, intercept = np.polyfit(x, y, 1)
fitted = intercept + slope * x
residuals = y - fitted
print("slope:", slope)
print("intercept:", intercept)
print("residuals:", residuals)Limitations and practical choices
Regression can show association, but omitted variables, reverse causality, or measurement error can make a causal interpretation invalid. Predictions outside the observed range of x are extrapolations and are especially risky. A statistically significant slope can also be economically unimportant.
When assumptions fail, first inspect the data and the reason for the failure. A logarithmic transformation may reduce skewness or stabilize variance. Adding a relevant variable may reduce omitted-variable bias. However, changing the model only to improve its appearance can create a different form of bias.
Exercise
Residuals form a clear U-shape, and the slope is statistically significant. What is the main concern?
Show answer
The linearity assumption is violated. The significant slope may summarize a curved relationship poorly, so inspect a plot and consider an appropriate functional form.