Omitted variable bias
The question
Tutoring hours and solo study are correlated. How much does leaving out solo study change the tutoring slope?
Make a guess, then compare it with two fits to the same simulated data.
- 1 SeeGuess how far the slope moves.
- 2 TryChange the two inputs and compare slopes.
- 3 ProveBuild the slope identity.
- 4 ApplyCalculate and interpret slope shifts.
Before you start · 3 quick checks on slopes, centering, and residuals
Two ideas before you start
2 ideasHold one input fixed
Two parallel slices of a fitted plane at different values of the second input.
A fit can use two inputs at once. Freeze one input, then trace the fitted outcome as the other input changes.
Exact definition
Let \(X\) and \(Z\) be inputs and \(Y\) the outcome. The fitted expression \(a+bX+gZ\) is a plane with intercept \(a\). At a fixed value \(Z=z\), the intercept of the resulting line is \(a+gz\) and its slope in \(X\) is \(b\). The coefficient \(g\) gives the slope in \(Z\) at fixed \(X\).
Multiple ordinary least squares (OLS) chooses \(a,b,g\) to minimize the sum of squared residuals, where a residual is observed \(Y\) minus fitted \(Y\). A fit with just \(X\) and an intercept is a short fit. A fit with \(X\), \(Z\) and an intercept is a long fit.
Use a line to summarize how inputs move together
Points for two inputs with a line fitted through them. The buttons switch between rising and falling examples.
A separate fit uses the second input \(Z\) as its outcome. Its slope tells you the fitted change in \(Z\) per unit of \(X\).
Exact definition
The auxiliary regression fits \(Z\) on an intercept and \(X\). In a population with finite second moments and positive variance of \(X\), its slope is \(d=\operatorname{Cov}(X,Z)/\operatorname{Var}(X)\). If \(Z\) also has positive variance, then
\[d=\rho\,\frac{\sigma_Z}{\sigma_X}.\]Here \(\rho\) is the correlation of \(X\) and \(Z\), and \(\sigma_X,\sigma_Z\) are their standard deviations. Correlation has no units. The auxiliary slope is in units of \(Z\) per unit of \(X\).
Fine print on centered data and population slopes
In a data set, center a column by subtracting its mean from every entry. Let \(S_{xz}\) be the sum of products of the centered \(X\) and \(Z\) columns, and let \(S_{xx}\) be the sum of squares of centered \(X\). The sample auxiliary slope is \(S_{xz}/S_{xx}\) when \(X\) varies. The least squares lesson derives this slope rule for any outcome column.
For a fit with an intercept, the residuals sum to zero. Their dot product with each included input column is zero as well. A dot product here means multiplying entries row by row and adding. OLS as a projection explains why the squared-error minimum has this property.
A population least-squares fit minimizes expected squared residual. The same equations use means and covariances in place of sample means and centered sums. A population slope describes a distribution, while a fitted sample slope describes the rows used to compute it.
Guess the shift in the tutoring slope
- Read the model's two slopes and the summary of study hours.
- Pick a signed change. The answer is for the population model.
In a fictional study, \(X\) is weekly tutoring time, \(Z\) is weekly solo study time, and \(Y\) is an assessment index measured in points. Both inputs are measured in hours relative to their population means. The model has an additive linear mean and an independent, mean-zero error.
The calculation and simulated fits open after you pick.
Fit both regressions to one simulated sample
The lines cross at the sample means of tutoring time and the assessment index. At that tutoring time the short fit gives the sample mean of the outcome, and the long fit gives it too when solo study is held at its sample mean. Away from that point the slopes can give different fitted changes.
How the sample was made
The population target uses the generating slopes and the population link between tutoring and solo study. The simulated slopes use the sample links instead. Taking a different sample can change each fitted slope and the gap between them.
Change the two links
Start with a different population. The outcome again has an additive linear mean and a mean-zero error independent of both inputs. The question asks for the short population slope itself.
The slope explorer opens after you check your prediction.
Compare the short and long slopes
- Change the auxiliary slope \(d\) or the long coefficient \(g\) on \(Z\).
- Use the tiles to judge the slopes, including when the lines overlap.
The explorer uses mean-zero inputs and outcomes, with positive variance of \(X\) and an independent, mean-zero outcome error. It models \(Z\) as \(dX\) plus independent mean-zero variation with positive variance, so you can change \(d\) while keeping enough variation to identify the two long coefficients.
Read the units and the sign
Read \(d\) as units of \(Z\) per unit of \(X\). Read \(g\) as units of \(Y\) per unit of \(Z\) at fixed \(X\). The units of \(Z\) cancel in \(gd\), so you can add the result to the long slope. If both links have the same sign and are nonzero, the shift is positive. Opposite signs give a negative shift.
A negative shift means the short slope is smaller than the long slope. To tell whether the short slope crosses zero, compare the size of the shift with the original slope. A negative shift can still leave a positive slope.
Derive the slope shift for the same rows
Use a common set of rows for both OLS fits, each with an intercept. Assume the intercept, \(X\) and \(Z\) columns are linearly independent. In particular, \(X\) varies, so the sum of squares \(S_{xx}\) defined below is positive. Denote the long coefficients on \(X\) and \(Z\) by \(b\) and \(g\), the short coefficient on \(X\) by \(c\), and the auxiliary slope of \(Z\) on \(X\) by \(d\).
Write \(x,z,y\) for the centered columns and \(e\) for the long residual column. Let \(S_{xz}=x\cdot z\), \(S_{xy}=x\cdot y\), and \(S_{xx}=x\cdot x\), using ordinary dot products. The exact difference is
\[c-b=gd.\]The identity holds for fixed data, including a perfect fit, zero slope or zero correlation. To build it, start with the long residual, then take the dot product with the centered \(X\) column.
From a slope comparison to bias
Suppose the population has finite second moments, positive variances for \(X\) and \(Z\), and a nonsingular covariance matrix for the pair. If \(Y=\alpha+\beta X+\gamma Z+U\) with \(\mathbb E[U\mid X,Z]=0\), the long population coefficient on \(X\) is \(\beta\). Here \(\alpha\) is the intercept and \(U\) is the population error. Covariance with \(X\) then gives the short population slope \(\beta+\gamma d\). The term \(\gamma d\) is the omitted variable bias relative to the coefficient \(\beta\).
The sample identity compares two fits on the same rows exactly. The population result compares two population coefficients. If a study drops rows with missing \(Z\) only in its long fit, its reported gap can also reflect the change in rows. To isolate the same-row comparison, refit the short model on the rows used in the long model.
What a change in coefficient can tell you
The algebra compares associations. For a causal reading of \(\beta\), the study design must justify interpreting a change in \(X\) at fixed \(Z\) as an intervention. Whether to adjust for \(Z\) depends on how it arises. For example, if tutoring changes solo study, adjustment can remove part of the total effect of tutoring. A causal diagram can help you state those relationships before fitting either regression.
If \(Z\) is an exact affine function of \(X\) in the observed rows, the long coefficients on the two inputs cannot be identified separately. The short slope can still be fitted as long as \(X\) varies. In that situation there is no unique same-row gap to interpret.
Problems
Use short minus long for signed differences. Assume both fits include intercepts, the long fit has independent predictors in the linear algebra sense, and the population summaries have finite second moments. Each question specifies whether the numbers are population summaries or coefficients fitted to the same observations.
Further reading
- J. M. Wooldridge, Introductory Econometrics: A Modern Approach, multiple regression and omitted variable bias.
- J. D. Angrist and J.-S. Pischke, Mostly Harmless Econometrics: An Empiricist's Companion, regression and causal inference.