Omitted-variable bias

In statistics, omitted-variable bias (OVB) occurs when a statistical model leaves out one or more relevant variables. The bias results in the model attributing the effect of the missing variables to those that were included.
More specifically, OVB is the bias that appears in the estimates of parameters in a regression analysis, when the assumed specification is incorrect in that it omits an independent variable that is a determinant of the dependent variable and correlated with one or more of the included independent variables.
In linear regression.
Intuition.
Suppose the true cause-and-effect relationship is given by:
with parameters "a, b, c", dependent variable "y", independent variables "x" and "z", and error term "u". We wish to know the effect of "x" itself upon "y" (that is, we wish to obtain an estimate of "b"). 
Two conditions must hold true for omitted-variable bias to exist in linear regression:
Suppose we omit "z" from the regression, and suppose the relation between "x" and "z" is given by
with parameters "d", "f" and error term "e". Substituting the second equation into the first gives
If a regression of "y" is conducted upon "x" only, this last equation is what is estimated, and the regression coefficient on "x" is actually an estimate of ("b" + "cf" ), giving not simply an estimate of the desired direct effect of "x" upon "y" (which is "b"), but rather of its sum with the indirect effect (the effect "f" of "x" on "z" times the effect "c" of "z" on "y"). Thus by omitting the variable "z" from the regression, we have estimated the total derivative of "y" with respect to "x" rather than its partial derivative with respect to "x". These differ if both "c" and "f" are non-zero.
The direction and extent of the bias are both contained in "cf", since the effect sought is "b" but the regression estimates "b+cf". The extent of the bias is the absolute value of "cf", and the direction of bias is upward (toward a more positive or less negative value) if "cf" > 0 (if the direction of correlation between "y" and "z" is the same as that between "x" and "z"), and it is downward otherwise.
Detailed analysis.
As an example, consider a linear model of the form
where
We collect the observations of all variables subscripted "i" = 1, ..., "n", and stack them one below another, to obtain the matrix "X" and the vectors "Y", "Z", and "U": 
and
If the independent variable "z" is omitted from the regression, then the estimated values of the response parameters of the other independent variables will be given by the usual least squares calculation,
(where the "prime" notation means the transpose of a matrix and the -1 superscript is matrix inversion).
Substituting for "Y" based on the assumed linear model,
On taking expectations, the contribution of the final term is zero; this follows from the assumption that "U" is uncorrelated with the regressors "X". On simplifying the remaining terms:
The second term after the equal sign is the omitted-variable bias in this case, which is non-zero if the omitted variable "z" is correlated with any of the included variables in the matrix "X" (that is, if "X′Z" does not equal a vector of zeroes). Note that the bias is equal to the weighted portion of "z""i" which is "explained" by "x""i".
Effect in ordinary least squares.
The Gauss–Markov theorem states that regression models which fulfill the classical linear regression model assumptions provide the most efficient, linear and unbiased estimators. In ordinary least squares, the relevant assumption of the classical linear regression model is that the error term is uncorrelated with the regressors.
The presence of omitted-variable bias violates this particular assumption. The violation causes the OLS estimator to be biased and inconsistent. The direction of the bias depends on the estimators as well as the covariance between the regressors and the omitted variables. A positive covariance of the omitted variable with both a regressor and the dependent variable will lead the OLS estimate of the included regressor's coefficient to be greater than the true value of that coefficient. This effect can be seen by taking the expectation of the parameter, as shown in the previous section.