Tutorials › Statistical Theory III - Theories of Inference, Multivariate Methods, and Contingency Tables › Overidentified IV Inference From Moments to Wald Tests

IV and Two-Stage Least Squares · Tutorial 541 of 972

Overidentified IV Inference From Moments to Wald Tests

Work through a numerical overidentified IV model and see how 2SLS, robust Wald inference, and a heteroskedasticity-robust overidentification test fit together.

Advanced 11 min read

What You'll Learn

  • Express an overidentified IV model as a system of sample moment conditions
  • Calculate 2SLS from the instrument and regressor cross-products
  • Estimate a heteroskedasticity-robust 2SLS covariance matrix
  • Form and interpret a coefficient Wald statistic
  • Explain why a robust overidentification test requires efficient GMM weighting
  • Calculate a two-step robust Hansen J statistic and identify its degrees of freedom

From Instrumental-Variables Moments to Inference

With more instruments than endogenous regressors, the sample moment conditions generally cannot all equal zero at the same parameter value. The estimator must combine those moments, and inference must account both for the resulting estimation uncertainty and for the possibility that the instruments’ restrictions are incompatible with the data. This tutorial follows those steps in one small numerical example.

Consider the linear model \(y_i=x_i'\beta+u_i\), with \(k\) regressors and \(q\) instruments, where \(q>k\). Write \(X\) for the \(n\times k\) regressor matrix and \(Z\) for the \(n\times q\) instrument matrix. The population moment restriction is \(E[z_i u_i]=0\). Identification requires that \(Q_{zx}=E[z_i x_i']\) have full column rank \(k\); in particular, the instruments must be sufficiently informative about the regressors. Assume independent, identically distributed observations, finite moments adequate for the central limit theorem and covariance estimation, and a positive-definite \(Q_{zz}=E[z_i z_i']\). For the usual asymptotic inference below, also assume the model and moment restrictions are correctly specified and identification is strong.

Definition: The sample moments at a candidate value \(\beta\) are \(\bar g_n(\beta)=n^{-1}Z'(y-X\beta)\). The model is overidentified when there are more moment restrictions than parameters, \(q>k\). The restrictions need not hold exactly in a finite sample, so estimation combines them rather than solving every sample moment equation.

Two-stage least squares (2SLS) combines these moments using the weight matrix corresponding to the sample instrument cross-products. Let \(P_Z=Z(Z'Z)^{-1}Z'\), assuming \(Z'Z\) is nonsingular. The estimator is

$$ \hat\beta_{\mathrm{2SLS}} =(X'P_ZX)^{-1}X'P_Zy. $$

This is also a generalized method of moments (GMM) estimator using the weight \((Z'Z/n)^{-1}\). In an overidentified model, \(\hat\beta_{\mathrm{2SLS}}\) ordinarily makes the weighted combination of sample moments as small as possible, not every moment zero.

Worked Through: Sample Moments and 2SLS

Worked Example: Constructing the Moments and Estimating 2SLS

Suppose the model has one endogenous regressor \(x\), one coefficient \(\beta\), and two instruments \(z_1,z_2\). The four observations are:

Observation \(i\)\(z_{1i}\)\(z_{2i}\)\(x_i\)\(y_i\)
111410
21-1-2-4
3-110-2
4-1-1-2-4

There are two moments for one coefficient, so this model is overidentified. Write \(z_1=(1,1,-1,-1)'\) and \(z_2=(1,-1,1,-1)'\). Their cross-product matrix is \(Z'Z=4I_2\). Direct multiplication gives \(Z'x=(4,8)'\) and \(Z'y=(12,16)'\). Thus the two sample moment equations, before dividing by \(n=4\), are \(Z'(y-x\beta)=(12-4\beta,\;16-8\beta)'\). They cannot both equal zero: the first would require \(\beta=3\), while the second would require \(\beta=2\).

For 2SLS, the projected regressor is \(P_Zx=Z(Z'Z)^{-1}Z'x=z_1+2z_2=(3,-1,1,-3)'\). Therefore \(x'P_Zx=20\) and \(x'P_Zy=(P_Zx)'y=44\). The estimate is

$$ \hat\beta_{\mathrm{2SLS}}=\frac{44}{20}=2.2. $$

The sample moments at this estimate are \(Z'(y-x\hat\beta)=(3.2,-1.6)'\), or \(\bar g_n(\hat\beta)=(0.8,-0.4)'\). Their nonzero values are not, by themselves, evidence that the population restrictions fail: sampling variation generally prevents all overidentifying moments from being zero.

Robust Covariance and a Coefficient Wald Test

Under heteroskedasticity, the variance of the moment vector depends on the observation-specific error variance. A heteroskedasticity-robust covariance estimator uses the squared 2SLS residuals rather than imposing a common error variance. Define \(\hat u_i=y_i-x_i'\hat\beta_{\mathrm{2SLS}}\), and let \(\widehat\Omega=n^{-1}\sum_{i=1}^n z_i z_i'\hat u_i^2\). Under the regularity and identification conditions stated above, the asymptotic covariance of \(\sqrt n(\hat\beta_{\mathrm{2SLS}}-\beta)\) is

$$ V_{\mathrm{2SLS}} =Q_{xz}Q_{zz}^{-1}\Omega Q_{zz}^{-1}Q_{zx} \text{ sandwiched by }(Q_{xz}Q_{zz}^{-1}Q_{zx})^{-1}, \qquad \Omega=E[z_i z_i'u_i^2], $$

where “sandwiched” means multiplying the displayed middle matrix on both sides by \((Q_{xz}Q_{zz}^{-1}Q_{zx})^{-1}\). In sample-matrix form, the estimated covariance of \(\hat\beta_{\mathrm{2SLS}}\) is

$$ \widehat{\operatorname{Var}}(\hat\beta_{\mathrm{2SLS}}) =(X'P_ZX)^{-1}X'P_Z \operatorname{diag}(\hat u_1^2,\ldots,\hat u_n^2) P_ZX(X'P_ZX)^{-1}. $$

This is the heteroskedasticity-robust sandwich covariance. It estimates uncertainty around 2SLS; it does not change the 2SLS point estimate.

Result: If \(Q_{zz}\) is positive definite, \(Q_{zx}\) has full column rank, the observations are independent and identically distributed, and the relevant moments are finite, then 2SLS is asymptotically normal under the valid-moment model. Replacing the population quantities in its asymptotic covariance by consistent sample estimates gives the robust covariance estimator above.

To see the source of this result, the sample moment equation can be linearized around the true \(\beta\). With \(Q_{zx}=E[z_i x_i']\), its first-order form is

$$ \sqrt n(\hat\beta_{\mathrm{2SLS}}-\beta) \ \xrightarrow{d}\ (Q_{xz}Q_{zz}^{-1}Q_{zx})^{-1} Q_{xz}Q_{zz}^{-1} \frac{1}{\sqrt n}\sum_{i=1}^n z_i u_i. $$

The central limit theorem gives the sum a limiting covariance \(\Omega=E[z_i z_i'u_i^2]\). Multiplying that covariance on the left and right by the displayed linear transformation gives the stated sandwich. The sample version substitutes \(n^{-1}Z'Z\), \(n^{-1}Z'X\), and \(n^{-1}\sum_i z_i z_i'\hat u_i^2\); under the stated conditions, these converge to their population counterparts. This derivation explains why a homoskedastic covariance formula is not generally valid when error variances differ across observations. \(\square\)

Worked Example: Robust Standard Error and Wald Test

Continue with the four observations. The 2SLS residuals are \(1.2,0.4,-2,0.4\), found by subtracting \(2.2x_i\) from each \(y_i\). The projected regressor is \(P_Zx=(3,-1,1,-3)'\), and \(X'P_ZX=20\). For this scalar model, the robust covariance estimate is therefore

$$ \frac{\sum_i (P_Zx)_i^2\hat u_i^2}{(X'P_ZX)^2} =\frac{9(1.2)^2+1(0.4)^2+1(-2)^2+9(0.4)^2}{20^2} =\frac{18.56}{400}=0.0464. $$

The robust standard error is \(\sqrt{0.0464}\approx0.2154\). To test \(H_0:\beta=2\) against a two-sided alternative, the Wald statistic is

$$ W=\frac{(\hat\beta_{\mathrm{2SLS}}-2)^2} {\widehat{\operatorname{Var}}(\hat\beta_{\mathrm{2SLS}})} =\frac{(2.2-2)^2}{0.0464} \approx0.862. $$

Under the null and the regularity conditions, \(W\) is compared asymptotically with a \(\chi^2_1\) distribution. Equivalently, the signed statistic is \(0.2/0.2154\approx0.93\), with a two-sided standard-normal reference. The approximate two-sided \(p\)-value is about \(0.35\); these data do not provide strong evidence against \(\beta=2\). Since \(n=4\) here, this calculation illustrates the procedure, not a reliable small-sample calibration.

Checking the Overidentifying Restrictions

A coefficient Wald test asks whether a specified value of \(\beta\) is plausible. An overidentification test asks a different question: are the extra instrument restrictions jointly compatible with the model? A robust Hansen \(J\) test uses efficient GMM weighting. Under the null, with valid moments, strong identification, and consistent estimation of the moment covariance, its statistic has an asymptotic \(\chi^2_{q-k}\) distribution.

The distinction in weighting matters. 2SLS uses the weight based on \(Q_{zz}^{-1}\). Under heteroskedasticity, that is not generally the efficient GMM weight, which is \(\Omega^{-1}\). A robust \(J\) test is obtained by minimizing the sample moments using a consistent estimate of \(\Omega^{-1}\), then evaluating the minimized criterion. The degrees of freedom are \(q-k\), the number of moment restrictions left after estimating \(k\) parameters.

Result: If \(\Omega\) is positive definite, \(q>k\), and the efficient GMM estimator uses a consistent estimate of \(\Omega^{-1}\), then under the null of valid moments, \(J=n\bar g_n(\hat\beta_{\mathrm{GMM}})'\widehat\Omega^{-1}\bar g_n(\hat\beta_{\mathrm{GMM}})\xrightarrow{d}\chi^2_{q-k}\). The limit follows because efficient weighting whitens the limiting moment vector, while estimation projects out the \(k\) parameter directions; the remaining squared length has \(q-k\) independent standard-normal components. \(\square\)

More explicitly, the central limit theorem makes the scaled moment vector converge to a \(q\)-dimensional normal vector with covariance \(\Omega\). Premultiplying by \(\Omega^{-1/2}\) gives a standard normal vector. Efficient estimation removes its component in the \(k\)-dimensional space that can be changed by varying \(\beta\). The residual component lies in a space of dimension \(q-k\); its squared Euclidean length has the \(\chi^2_{q-k}\) distribution. Consistent estimation of \(\Omega\) preserves this limit.

Worked Example: A Robust Overidentification Check

For the same data, the 2SLS residuals give the preliminary robust moment covariance

$$ \widehat\Omega =\frac14\sum_i z_i z_i'\hat u_i^2 =\begin{pmatrix}1.44&-0.64\\-0.64&1.44\end{pmatrix}, \qquad \widehat\Omega^{-1} =\begin{pmatrix}45/52&5/13\\5/13&45/52\end{pmatrix}. $$

Use this consistent two-step GMM weighting estimate for the illustration. The cross-products are \(Z'X=(4,8)'\) and \(Z'y=(12,16)'\). Minimizing the weighted moments gives

$$ \hat\beta_{\mathrm{GMM}} =\frac{(Z'X)'\widehat\Omega^{-1}Z'y} {(Z'X)'\widehat\Omega^{-1}Z'X} =\frac{2780/13}{1220/13} =\frac{139}{61}\approx2.279. $$

The unscaled residual moment vector is \(r=Z'(y-X\hat\beta_{\mathrm{GMM}})=(176/61,-136/61)'\). Since \(\bar g_n=r/4\), the robust \(J\) statistic is

$$ J=4\bar g_n'\widehat\Omega^{-1}\bar g_n =\frac14r'\widehat\Omega^{-1}r =\frac14\left(\frac{24400}{3721}\right) \approx1.639. $$

There are \(q-k=2-1=1\) overidentifying restriction, so the reference distribution is \(\chi^2_1\). The approximate \(p\)-value is about \(0.20\), which is not strong evidence against the joint instrument restrictions. Again, with only four observations the asymptotic reference is illustrative rather than dependable. In applied work, the moment covariance and weighting matrix are estimated from a substantially larger sample.

Common Pitfall and Interpretation

A common mistake is to calculate \(n\bar g_n'\widehat\Omega^{-1}\bar g_n\) using the 2SLS residual moments and then automatically compare it with \(\chi^2_{q-k}\). That statistic does not generally have the robust Hansen \(J\) reference distribution: under heteroskedasticity, 2SLS does not minimize the criterion using \(\widehat\Omega^{-1}\). The correction is to use a robust efficient-GMM estimator for the \(J\) check, or to use a test procedure whose stated assumptions match the estimator and covariance actually used. The robust 2SLS covariance remains appropriate for the 2SLS coefficient Wald test; it does not turn 2SLS into efficient GMM.

Nor does failure to reject the overidentifying restrictions prove that every instrument is valid. The test assesses their joint compatibility with the model and can have limited power. A rejection signals that at least one maintained restriction or part of the model is questionable; it does not identify which instrument is responsible. These checks complement substantive justification for instrument validity rather than replace it.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. In a model with four instruments and two coefficients, how many overidentifying restrictions are tested by the efficient-GMM \(J\) statistic?
  2. Why can the two sample moment equations in the numerical example not both equal zero at the same value of \(\beta\)?
  3. What feature of the robust 2SLS covariance allows it to accommodate heteroskedasticity?
  4. Why is the robust \(J\) test not generally obtained by evaluating the efficient-GMM criterion at the 2SLS estimate?
  5. In the numerical example, what null hypothesis does the coefficient Wald test address, and what different null does the overidentification test address?
Clinical Biostats