Tutorials › Propensity Score Matching and Instrumental Variables › Interactions With Endogenous Regressors

Two-Stage Least Squares · Tutorial 502 of 699

Interactions With Endogenous Regressors

Learn to specify and estimate a 2SLS model with an endogenous interaction, and to check the assumptions that justify its instruments.

Advanced 11 min read

What You'll Learn

  • Specify a structural equation with an endogenous regressor and its interaction with an exogenous variable.
  • Identify the full instrument set, including instruments for the endogenous interaction.
  • State the validity, relevance, and rank conditions needed for 2SLS.
  • Construct first-stage fitted values for each endogenous regressor without multiplying fitted values together.
  • Work through a numerical 2SLS calculation and diagnose invalid interaction instruments.

Why Interactions Need Their Own Instruments

An interaction allows the relationship between a treatment or exposure and an outcome to vary with another variable. If the treatment is endogenous, its interaction with an otherwise exogenous variable is generally endogenous too. Instrumenting the treatment alone and then using its observed interaction in the outcome equation does not address this second source of endogeneity.

Let \(x\) be an endogenous regressor, \(q\) an exogenous variable, and \(z\) an excluded instrument. A linear structural equation with an interaction is

$$ y_i=\beta_0+\beta_1x_i+\beta_2q_i+\beta_3(x_iq_i)+u_i. $$

Here \(x_iq_i\) is a separate regressor, not a substitute for \(x_i\). Even though \(q_i\) is exogenous, the product \(x_iq_i\) can be correlated with the structural error \(u_i\), because it contains the endogenous variable \(x_i\). Thus the endogenous-regressor vector is \(D_i=(x_i,\ x_iq_i)'\), while the included exogenous variables are \(C_i=(1,\ q_i)'\).

Definition: In a 2SLS model containing \(x\) and \(xq\), the endogenous regressors are instrumented jointly. The instrument set includes the included exogenous regressors and excluded instruments for both endogenous terms. With excluded instrument \(z\), a standard candidate set is \(1,\ q,\ z,\ zq\).

The product \(zq\) is the natural excluded instrument for \(xq\), but its validity is an assumption, not an algebraic consequence of \(E[zu]=0\). A useful sufficient condition is conditional instrument exogeneity, \(E[u\mid z,q]=0\). It implies the required moments \(E[zu]=0\), \(E[zqu]=0\), and \(E[qu]=0\), provided the relevant expectations exist. More generally, validity must be justified directly for every instrument in the set. In particular, \(q\) must itself be exogenous, and the exclusion restriction must rule out direct effects of \(z\) and \(zq\) on \(y\) other than through the modeled endogenous regressors.

Model, Assumptions, and 2SLS Construction

Write the sample model as \(y=C\gamma+D\beta+u\), where \(C\) contains the intercept and exogenous regressors, and \(D\) contains \(x\) and \(xq\). Let \(H=[C,Z]\) be the full instrument matrix, with \(Z\) containing the excluded instruments, such as \(z\) and \(zq\). The standard 2SLS estimator is

$$ \widehat{\theta}_{2SLS}=(R'P_HR)^{-1}R'P_Hy,\qquad R=[C,D],\qquad P_H=H(H'H)^{-1}H'. $$

This formula requires the matrix being inverted to have full rank. In population terms, the instruments must be relevant enough to identify the distinct coefficients on \(x\) and \(xq\), after accounting for the included exogenous regressors. Having as many instruments as endogenous regressors is not, by itself, a guarantee of identification; the excluded instruments must supply independent predictive variation for the two endogenous terms.

The core assumptions are: (1) the structural equation is correctly specified for the intended linear model; (2) every instrument is exogenous, so its moment with \(u\) is zero; (3) excluded instruments affect \(y\) only through the modeled endogenous regressors; (4) the instrument set has sufficient rank and relevance; and (5) the observations and moments satisfy the regularity conditions needed for the chosen inference procedure. These assumptions concern the model and design, not merely the calculation of fitted values.

In the first stage, project each column of \(D\) separately on the same full instrument matrix \(H\). In particular, fit \(x\) on \(C,z,zq\), and fit \(xq\) on \(C,z,zq\). The resulting fitted columns are the two columns of \(P_HD\). The second stage uses both fitted columns alongside the included exogenous variables. This implements the matrix formula above; uncertainty must be calculated with 2SLS-appropriate standard errors, not as though the fitted regressors were observed without estimation.

Key construction: The fitted interaction column is the projection of the observed product \(xq\) on the instruments. It is generally not \(q\) multiplied by the fitted value of \(x\). The latter is a different variable and need not equal \(P_H(xq)\).

Worked Estimation

Worked Example: Instrumenting a Treatment and Its Interaction

Suppose a hypothetical dataset has structural equation \(y=\beta_0+\beta_1x+\beta_2q+\beta_3xq+u\). The analyst treats \(x\) as endogenous, \(q\) as exogenous, and has excluded instruments \(z\) and \(zq\). To keep the arithmetic focused on the endogenous coefficients, suppose all variables below have first been residualized with respect to the included regressors \(1\) and \(q\). The two resulting excluded-instrument columns are denoted \(z_1,z_2\); they are orthogonal and satisfy \(Z'Z=40I\). Here \(Z=[z_1,z_2]\), and \(w=xq\).

Suppose the hypothetical cross-products are

$$ Z'[x,\ w]= \begin{pmatrix} 80&20\\ 10&60 \end{pmatrix}. $$

The first-stage coefficient matrix is \((Z'Z)^{-1}Z'[x,w]\). Since \((Z'Z)^{-1}=(1/40)I\), the fitted columns are

$$ \widehat{x}=2z_1+0.25z_2,\qquad \widehat{w}=0.5z_1+1.5z_2. $$

For example, the coefficient on \(z_1\) in the fitted \(w\) column is \(20/40=0.5\), using the first row and second column of \(Z'[x,w]\). The coefficient on \(z_2\) in that column is \(60/40=1.5\). This calculation illustrates why each column and cross-product must be checked separately.

The cross-product matrix of the fitted endogenous regressors is

$$ \widehat{D}'\widehat{D} =40 \begin{pmatrix} 2&0.5\\ 0.25&1.5 \end{pmatrix}'\! \begin{pmatrix} 2&0.5\\ 0.25&1.5 \end{pmatrix} = \begin{pmatrix} 162.5&55\\ 55&100 \end{pmatrix}. $$

Suppose the residualized outcome has cross-products \(\widehat{D}'y=(490,\ 410)'\). The 2SLS estimates of the two endogenous coefficients solve

$$ \begin{pmatrix} 162.5&55\\ 55&100 \end{pmatrix} \begin{pmatrix}\widehat{\beta}_1\\\widehat{\beta}_3\end{pmatrix} = \begin{pmatrix}490\\410\end{pmatrix}. $$

The solution is \(\widehat{\beta}_1=2\) and \(\widehat{\beta}_3=3\), because \(162.5(2)+55(3)=490\) and \(55(2)+100(3)=410\). The example reports the coefficients on \(x\) and \(xq\); the coefficients on the included regressors are handled in the full regression. Under the model, the interaction coefficient is measured in outcome units per unit of \(x\) per unit of \(q\).

The arithmetic does not establish that the instruments are valid. Before interpreting these estimates causally, the analyst would still need to defend the exclusion and exogeneity assumptions and establish that the instrument variation identifies both endogenous coefficients.

Why the Interaction Instrument Must Be Valid

Unconditional validity of \(z\) alone does not ensure validity of \(zq\). The following small hypothetical probability example isolates the issue. Let \(z\) take values \(-1\) and \(1\) with equal probability, and let \(q\) be independent of \(z\), taking values 0 and 1 with equal probability. Define the error as \(u=z(q-0.5)\). Then

$$ E[zu]=E[q-0.5]=0,\qquad E[qu]=0, \qquad E[zqu]=E[q(q-0.5)]=0.25. $$

Thus \(z\) and \(q\) each satisfy their own zero-moment condition in this example, but their product \(zq\) does not. The conditional mean of the error given \(z,q\) is not zero, so the stronger sufficient condition stated earlier fails. The example shows why an analyst cannot simply multiply a valid instrument by an exogenous variable and declare the product valid without examining the assumptions that support it.

Diagnostics, Alternatives, and Limitations

Several checks are especially important in an interaction model:

  • Check the first stages for both endogenous columns. The fitted \(x\) and fitted \(xq\) columns must be generated from the full instrument set. Inspect whether the excluded instruments provide distinct predictive variation after the included exogenous regressors are accounted for.
  • Check the rank and specification. If \(zq\) adds no independent variation beyond \(z\), \(q\), and the other instruments, the interaction coefficient may not be identified. A model can have multiple instrument columns yet still lack the rank needed to distinguish the endogenous effects.
  • Check instrument validity in context. Ask whether \(z\) or \(zq\) could affect the outcome directly, and whether the relationship between \(q\) and the error makes the product instrument problematic. A strong first stage does not repair a failed exclusion restriction.
  • Check coding and construction. Verify that the observed interaction is formed from the intended \(x\) and \(q\), and that the first-stage regression for it uses this observed product as its dependent variable.

The main alternative is ordinary least squares on the structural equation. OLS uses observed \(x\) and \(xq\) directly, but if either is correlated with \(u\), its coefficients generally do not identify the intended structural parameters. Another tempting shortcut is to fit \(x\), multiply \(\widehat{x}\) by \(q\), and use that product as the interaction column. This is not the 2SLS projection of \(xq\) on the instrument space, so it does not generally implement 2SLS. Likewise, instrumenting \(x\) while leaving \(xq\) untreated leaves an endogenous regressor in the equation.

Interactions can also make relevance and interpretation more demanding. Even when \(z\) predicts \(x\), the instrument set may not contain enough independent variation to identify both \(x\) and \(xq\). If \(q\) has little variation, or if the instrument effects vary little across values of \(q\), the interaction first stage may be weak. Validity and relevance are distinct: relevance is about prediction and rank, while validity is about the instrument-error moments and exclusion restriction. Neither can be inferred from the other.

A correct 2SLS computation therefore does not by itself establish a causal conclusion. The result depends on the structural equation, the instrument assumptions, the identification supplied by the design, and inference appropriate to the data. The earlier material on 2SLS standard errors and inference applies to this model as well; the presence of an interaction does not make naive second-stage standard errors valid.

1
Write the structural regressors.
Include \(x\), \(q\), and the observed product \(xq\); identify which are endogenous and which are exogenous.
2
Build the instrument matrix.
Include all included exogenous regressors and candidate excluded instruments for each endogenous term, such as \(z\) and \(zq\).
3
Defend validity and relevance.
State why every instrument is exogenous and excluded, and why the instrument set has enough independent predictive variation.
4
Project each endogenous column.
Regress \(x\) and the observed \(xq\) separately on the same full instrument matrix, then use both fitted columns in 2SLS.

Common Pitfalls

Common mistake: “\(z\) is a valid instrument for \(x\), so \(zq\) must be a valid instrument for \(xq\).” This conclusion does not follow from \(E[zu]=0\) alone. The correction is to justify the moment for \(zq\) as well, for example through \(E[u\mid z,q]=0\), and to verify that \(q\) is exogenous.

Common mistake: “The interaction first stage is \(q\widehat{x}\).” The correction is to project the observed product \(xq\) onto the full instrument set as its own first-stage dependent variable.

Check Your Understanding

Answer each question, then compare your reasoning with the brief solutions.

  1. In a model containing \(x\), \(q\), and \(xq\), where \(x\) is endogenous and \(q\) is exogenous, which regressors must be instrumented?
  2. With included regressors \(1,q\) and excluded instrument \(z\), state a standard candidate instrument set.
  3. Why is multiplying the first-stage fitted value of \(x\) by \(q\) generally not the correct fitted interaction column?
  4. If \(E[zu]=0\), does that alone establish \(E[zqu]=0\)? State a sufficient stronger condition.
  5. For the cross-products \(Z'Z=40I\) and \(Z'[x,xq]=\begin{pmatrix}80&20\\10&60\end{pmatrix}\), calculate the two first-stage fitted columns.

Solutions. (1) Both \(x\) and \(xq\) are generally endogenous and must be instrumented jointly. (2) A candidate set is \(1,q,z,zq\), subject to validity and relevance. (3) It is not generally the projection of the observed \(xq\) column on the instrument matrix. (4) No. \(E[u\mid z,q]=0\) is a sufficient condition that implies both moments, assuming the expectations exist. (5) Multiply each cross-product by \(1/40\): \(\widehat{x}=2z_1+0.25z_2\) and \(\widehat{xq}=0.5z_1+1.5z_2\).

Clinical Biostats