Tutorials › Econometrics (Graduate) › Deriving The Durbin-Wu-Hausman Endogeneity Test

Endogeneity and Control Functions · Tutorial 232 of 952

Deriving The Durbin-Wu-Hausman Endogeneity Test

Learn how residual inclusion turns an endogeneity question into a test of added terms, and when that test corresponds to a Hausman comparison.

Advanced 12 min read

What You'll Learn

  • State the assumptions that support a residual-inclusion test of exogeneity.
  • Derive why the null sets the first-stage residual coefficients to zero.
  • Calculate the test statistic and its degrees of freedom from the added design rank.
  • Recognize when collinear residual columns permit fewer than q independent tests.
  • Relate the residual-inclusion test to a Hausman comparison of OLS and IV estimates.
  • Distinguish evidence against exogeneity from evidence about instrument validity.

Why Test for Endogeneity?

When a regressor is correlated with the structural error, ordinary least squares (OLS) generally does not consistently estimate its structural coefficient. Instrumental variables (IV) can provide a consistent alternative when the instruments are valid and relevant, but the OLS and IV estimates may differ substantially in a particular sample even when the regressor is exogenous. The Durbin-Wu-Hausman (DWH) test formalizes the question of whether the observed difference is larger than sampling variation would plausibly explain under exogeneity.

One way to derive the test is to add residuals from first-stage regressions to the structural equation. Under a linear control-function representation, these residuals capture the component of the endogenous regressors that is related to the structural error. The test asks whether that component contributes to the outcome equation after the original regressors are included.

Model, Assumptions, and Null Hypothesis

Let \(y\) be an \(n\)-vector of outcomes, \(W\) an \(n\)-by-\(k\) matrix of included exogenous regressors (including an intercept if appropriate), and \(X\) an \(n\)-by-\(q\) matrix of potentially endogenous regressors. Let \(Z\) contain excluded instruments. Write the structural equation as \(y=W\alpha+X\beta+u\). The exogeneity question concerns whether \(X\) is uncorrelated with \(u\), conditional on \(W\).

For the residual-inclusion derivation, assume the instruments and included exogenous regressors are exogenous, \(E[u\mid W,Z]=0\), and the first stages have the linear form \(X=W\Pi_W+Z\Pi_Z+V\). The instruments must be relevant enough for the IV model to identify the structural coefficients being considered. In addition, assume a linear control-function representation \(E[u\mid W,Z,V]=V\delta\) and a conditional-mean first stage \(E[V\mid W,Z]=0\). The regression directly tests whether the identifiable residual coefficients are zero; interpreting this restriction as equivalent to conditional-mean exogeneity, \(E[u\mid W,X]=0\), additionally requires a rank condition ensuring that \(E[V\mid W,X]\delta=0\) almost surely implies zero coefficients in every identifiable residual direction. The null is that the identifiable components of \(\delta\) are zero; the alternative is that at least one identifiable residual direction has a nonzero coefficient.

Definition: The residual-inclusion DWH test directly tests whether the identifiable first-stage residual contribution has zero coefficients in the structural outcome regression. Interpreting these restrictions as conditional-mean exogeneity, \(E[u\mid W,X]=0\), requires the additional conditional-moment and rank assumptions stated above.

Estimate each column of \(X\) by regressing it on the same first-stage regressors, \(W\) and \(Z\). Denote the fitted values by \(\hat X\) and the residual matrix by \(\hat V=X-\hat X\). The augmented outcome regression is \(y=W\alpha+X\beta+\hat V\gamma+\text{error}\). Its restricted version omits \(\hat V\). The test compares these nested regressions; it does not replace \(X\) in the structural equation with its fitted values.

Why the Residual Coefficients Test Exogeneity

The derivation follows by substituting the first-stage decomposition into the conditional error representation. At the population level, \(X=W\Pi_W+Z\Pi_Z+V\), so under the stated representation the structural equation can be written as

$$ y=W\alpha+X\beta+V\delta+\varepsilon,\qquad E[\varepsilon\mid W,Z,V]=0. $$

If \(\delta=0\), the conditional mean of the structural error does not depend on the first-stage residual component, and the residual terms do not belong in the outcome equation. If \(\delta\ne0\), the residual component carries information about \(u\) not captured by the included regressors. In a sample, \(\hat V\) estimates \(V\), so testing the added residual terms is the regression implementation of this null.

This interpretation requires the assumptions above. In particular, rejection does not establish that the instruments are valid: the null concerns exogeneity of \(X\), whereas instrument validity is a separate assumption about the relationship between \(Z\) and \(u\). An invalid instrument can undermine the IV comparison even if a residual-inclusion regression can be calculated.

Worked Example: A Single Endogenous Regressor

Consider a hypothetical, deliberately constructed sample of \(n=8\) observations. Let \(W\) be an intercept, let \(Z\) take the values \((1,1,1,1,-1,-1,-1,-1)/\sqrt{2}\), and let the first-stage residual vector be \(v=(1,1,-1,-1,1,1,-1,-1)/\sqrt{2}\). Define \(X=Z+v\). Both \(Z\) and \(v\) have mean zero, are orthogonal, and have squared length 4. Thus, the first-stage regression of \(X\) on an intercept and \(Z\) has residual \(v\).

For illustration, define the outcome by \(y=2+1.5X+3v+e\), where \(e=(1,-1,1,-1,1,-1,1,-1)\). The vector \(e\) is orthogonal to the intercept, \(Z\), and \(v\), and \(e'e=8\). Under the restricted regression on an intercept and \(X\), \(v\) is orthogonal to the intercept but not to \(X\), since \(v'X=4\). Projecting \(3v\) onto centered \(X\) leaves a squared residual length of 18, so \(RSS_R=18+e'e=26\). In the augmented regression, the coefficient on \(v\) is 3 and the residual sum of squares is \(e'e=8\).

The restricted design has rank 2. Adding \(v\) increases the design rank by 1, so the unrestricted design has rank \(k_u=3\). The partial F statistic is

$$ F=\frac{(26-8)/1}{8/(8-3)} =\frac{18}{1.6} =11.25. $$

Under the conventional homoskedastic Gaussian regression assumptions, this is compared with an \(F(1,5)\) distribution. The statistic is large, giving evidence against the null that the residual contribution is zero. In this constructed example, the outcome and first-stage values were generated with a residual coefficient of 3; that construction is illustrative, not evidence about any real population.

Test Statistic and Degrees of Freedom

Let \(R=[W,X]\) denote the restricted design and \(U=[W,X,\hat V]\) the augmented design. Let \(RSS_R\) and \(RSS_U\) be the residual sums of squares from the restricted and unrestricted regressions. Define \(r=\operatorname{rank}(U)-\operatorname{rank}(R)\): it is the number of independent directions added by the residual columns after accounting for the restricted regressors. Let \(k_u=\operatorname{rank}(U)\). Under the classical linear regression assumptions, the partial F statistic is

$$ F=\frac{(RSS_R-RSS_U)/r}{RSS_U/(n-k_u)}. $$

The numerator degrees of freedom are \(r\), not automatically \(q\). They equal \(q\) only if the \(q\) residual columns add \(q\) independent directions conditional on the restricted design. If some residual columns are redundant after accounting for \(W\) and \(X\), the test has fewer numerator degrees of freedom and tests only the identifiable residual contribution. The denominator degrees of freedom are \(n-k_u\), with \(k_u\) counting linearly independent columns, including an intercept if present.

The conventional finite-sample F reference distribution requires the usual fixed-design linear regression conditions, including homoskedastic Gaussian errors under the null and a full-rank parameterization for the estimable terms. Without those conditions, the displayed conventional F calibration need not be valid. The central point for this tutorial is that the tested dimension is determined by the rank added to the design, not by the number of residual columns written down.

Worked Example: Two Residual Columns but One Testable Direction

Suppose there are two endogenous regressors with first-stage decompositions \(X_1=Z_1+v\) and \(X_2=Z_2+v\). Their estimated first-stage residual columns are identical: \(\hat v_1=\hat v_2=v\). Assume \(v\) is not in the span of the restricted regressors, so it adds one independent design direction. In the augmented outcome regression, the two residual terms combine as \(v\gamma_1+v\gamma_2=v(\gamma_1+\gamma_2)\).

Only the sum \(\gamma_1+\gamma_2\) is identified by this added direction; the individual coefficients cannot be distinguished from one another. Suppose a hypothetical regression comparison gives \(n=20\), \(k_u=5\), \(RSS_R=30\), and \(RSS_U=18\). The rank increase is \(r=1\), not \(q=2\), and hence

$$ F=\frac{(30-18)/1}{18/(20-5)} =\frac{12}{1.2} =10.00. $$

The conventional reference distribution is \(F(1,15)\), with an upper-tail p-value of approximately 0.006. This is evidence against a zero contribution in the one identifiable residual direction. It is not a separate two-degree-of-freedom test of each residual coefficient. Testing two independent residual restrictions would require the residual columns to contribute two independent directions conditional on the restricted design.

Connection to the Hausman Comparison

The same exogeneity question can be expressed by comparing OLS and IV estimates of \(\beta\). Under the null and the classical conditions that make OLS efficient among the estimators being compared, both estimates target the same structural coefficient, while IV is generally less precise. Under the alternative, OLS is generally inconsistent, whereas IV remains consistent if the instruments are valid and relevant. A systematic difference between the estimates is therefore evidence against the exogeneity null, subject to those assumptions.

Write \(d=\hat\beta_{IV}-\hat\beta_{OLS}\). Under the null, the classical Hausman covariance identity is \(\operatorname{Var}(d)=\operatorname{Var}(\hat\beta_{IV})-\operatorname{Var}(\hat\beta_{OLS})\). When this covariance difference is nonsingular, the Hausman statistic is

$$ H=d'\left[\widehat{\operatorname{Var}}(\hat\beta_{IV}) -\widehat{\operatorname{Var}}(\hat\beta_{OLS})\right]^{-1}d. $$

With \(q\) independently identified endogenous coefficients and the classical null conditions, it is compared asymptotically with a chi-square distribution with \(q\) degrees of freedom. If the comparison covariance has lower rank, the test is limited to its estimable directions, and the degrees of freedom are the rank of that comparison. The residual-inclusion regression and the Hausman comparison are two ways of expressing the same underlying check in the classical setup: whether the part of \(X\) not explained by the instruments and \(W\) is related to the structural error. They should not be assumed numerically identical in every implementation or under every covariance estimator.

Worked Example: Interpreting a Hausman Statistic

Suppose a hypothetical analysis estimates one structural coefficient as \(\hat\beta_{OLS}=1.20\) and \(\hat\beta_{IV}=1.80\). Suppose their estimated variances under the classical Hausman comparison are 0.04 and 0.13, respectively, so the estimated variance of their difference under the null is \(0.13-0.04=0.09\). The difference is \(d=1.80-1.20=0.60\), and the statistic is

$$ H=\frac{(0.60)^2}{0.09}=4.00. $$

For one compared coefficient, the reference distribution is chi-square with one degree of freedom; the upper-tail p-value is approximately 0.0455. At a 5% significance level, this is evidence against the exogeneity null under the assumptions used to form the comparison. It is not a 4% probability that the null is true, and it does not show that the instrument is valid.

Common Pitfalls and Practical Meaning

  • Using \(q\) degrees of freedom automatically. The number of residual columns is not necessarily the number of independent restrictions. Compute the rank increase conditional on the restricted regressors.
  • Interpreting rejection as proof of valid instruments. The test concerns exogeneity of \(X\); instrument validity is a distinct requirement for the IV interpretation.
  • Using fitted \(X\) in place of \(X\) in the outcome regression. The residual-inclusion test retains \(X\) and adds \(\hat V\). Replacing \(X\) with \(\hat X\) is not this test.
  • Treating a non-rejection as proof of exogeneity. A non-significant result means the test did not find sufficiently strong evidence against its null; limited precision or weak identifying information can also produce non-rejection.

The DWH test matters because it makes a model comparison interpretable as a targeted restriction: do the first-stage residual directions help explain the outcome once \(W\) and \(X\) are included? Its conclusion is conditional on a correctly specified linear model, the control-function representation, and the assumptions behind its reference distribution. Reporting the tested rank, the reference distribution, and the role of instrument assumptions makes that conclusion much clearer.

Check Your Understanding

Use the assumptions and rank logic developed above to answer these questions.

  1. In the residual-inclusion regression, what does the null hypothesis say about the residual contribution to the outcome?
  2. If three residual columns add only two independent directions conditional on the restricted design, what is the numerator degrees of freedom for the conventional partial F test?
  3. Why does rejection of a DWH exogeneity test not establish that the instruments are valid?
  4. In the Hausman comparison, what does the covariance identity express under the classical null?
  5. If two first-stage residual columns are identical, which residual-coefficient combination can the augmented outcome regression identify?
Clinical Biostats