Formal test for exogeneity of instruments Is there a way for me to formally test the exogeneity of my instruments? For instance, I have an endogenous variable, FDI, which I am instrumenting with "ease of doing business ratings," as a better score on ease of doing business improves the FDI inflows into an economy. How would I test that this instrument is not related to my dependent variable (patent grant) in the structural model?
 A: If you have exactly as many instrumental variables as endogenous regressors, then there is no way to test for IV validity in a homogenous effects model. 
Consider, for example the following model:
$$
Y = \alpha + \beta D + U 
$$
This is a homogeneous effects model: the treatment effect is a constant $\beta$ that is the same for everyone. The two IV assumptions are relevance and exogeneity. Relevance requires that $\text{Cov}(Z,D) \neq 0$. This is directly testable. Exogeneity requires that $\text{Cov}(Z,U) = 0$. This cannot be tested. To see why suppose that $Z$ is in fact an endogenous instrument, i.e. that 
Suppose that $Z$ is in fact an invalid instrument, i.e. that $\text{Cov}(Z,U) \neq 0$.
In this case the IV estimand is still perfectly well-defined, it simply doesn't equal $\beta$:
$$
  \beta_{IV} = \frac{\text{Cov}(Z,Y)}{\text{Cov}(Z,D)} = \beta + \frac{\text{Cov}(Z,U)}{\text{Cov}(Z,D)}, \quad 
  \alpha_{IV} = \mathbb{E}(Y) - \beta_{IV} \mathbb{E}(D).
$$
Now, let $V$ be the IV residual: $V \equiv Y - \alpha_{IV} - \beta_{IV} D$.
Note that $V$ is only equal to $U$ if $Z$ is a valid instrument, because this is the only way that we can have $\beta_{IV} = \beta$ and $\alpha_{IV} = \alpha$.
Using our definition of $V$, we can calculate $\text{Cov}(Z,V)$ as follows:
\begin{align*}
  \text{Cov}(Z,V) &= \text{Cov}(Z, Y - \alpha_{IV} - \beta_{IV} D) = \text{Cov}(Z,Y) - \beta_{IV} \text{Cov}(Z,D) \\
  &= \text{Cov}(Z,Y) - \frac{\text{Cov}(Z,Y)}{\text{Cov}(Z,D)} \text{Cov}(Z,D) = 0.
\end{align*}
In other words, $Z$ is always perfectly uncorrelated with the IV residual $V$ by construction, regardless of whether $Z$ is correlated with the structural error $U$.
A Durbin-Hausman-Wu test checks whether the OLS and IV estimands are the same. This does not tell us whether the instrument is invalid. 
When there are more instruments than endogenous regressors, an overidentifying restrictions test can be used to test the null hypothesis that both instruments are valid. The intuition is as follows. Continue to assume that $Y = \alpha + \beta D + U$ but suppose now that we have two relevant instruments $Z_1$ and $Z_2$, i.e. $\text{Cov}(Z_1, D) \neq 0$ and $\text{Cov}(Z_2,D)\neq 0$. Define two IV estimands: one that uses $Z_1$ to instrument for $D$ and another that uses $Z_2$, namely
$$
  \beta_{IV}^{(1)} \equiv \frac{\text{Cov}(Z_1,Y)}{\text{Cov}(Z_1,D)} = \beta + \frac{\text{Cov}(Z_1,U)}{\text{Cov}(Z_1,D)}
$$
and
$$
  \beta_{IV}^{(2)} \equiv \frac{\text{Cov}(Z_2,Y)}{\text{Cov}(Z_2,D)} = \beta + \frac{\text{Cov}(Z_2,U)}{\text{Cov}(Z_2,D)}.
$$
Taking differences of the two estimands, we obtain
$$
  \beta_{IV}^{(1)} - \beta_{IV}^{(2)} = \frac{\text{Cov}(Z_1,U)}{\text{Cov}(Z_1,D)} - \frac{\text{Cov}(Z_2,U)}{\text{Cov}(Z_2,D)}.
$$
If both $Z_1$ and $Z_2$ are valid instruments, then $\text{Cov}(Z_1,U) = \text{Cov}(Z_2,U) = 0$ which implies $\beta_{IV}^{(1)} - \beta_{IV}^{(2)} = 0$.
Therefore, if $\beta_{IV}^{(1)}$ and $\beta_{IV}^{(2)}$ differ then at least one of the instruments $(Z_1,Z_2)$ must be invalid.
While it is formulated in a slightly different way, a test of overidentifying restrictions exploits this basic intuition to provide a test of the joint null hypothesis that both instruments are valid: $\text{Cov}(Z_1,U) = \text{Cov}(Z_2,U) = 0$.
While this example concerns two instruments in a model with a single endogenous regressor, the same idea applies whenever there are more instruments than endogenous regressors.
In a model with heterogeneous treatment effects, the equivalent of instrument exogeneity does have testable implications even if there are as many endogenous regressors as instruments. See the following references for details:


*

*Huber, Martin, and Giovanni Mellace. "Testing instrument validity for
LATE identification based on inequality moment constraints." Review
of Economics and Statistics 97.2 (2015): 398-411.

*Mourifié, Ismael, and Yuanyuan Wan. "Testing local average treatment effect assumptions." Review of Economics and Statistics 99.2 (2017): 305-313.

*Kitagawa, Toru. "A test for instrument validity." Econometrica 83.5 (2015): 2043-2063. 

A: Hausman and Wu specifications and the test for over identification will do.
A: You're confusing the concept of endogeneity of instrument with its independence from your outcome. 
Given the equation:
$y=\beta_0+\beta_1x+\beta_2z+u$
where $y$ is the outcome, $x$ is the endogenous variable, $z$ is an instrument, and $u$ are unobservables.  Endogeneity is what happens when one or more of your right-hand-side variables is correlated with $u$, so for your instrument to be endogenous, it would have to be correlated with $u$ and not $y$. 
Recall the 3 criteria for a valid instrument (Wooldridge, 2009):


*

*$cov(z,y)=0$

*$cov(z,x)≠0$

*$cov(z,u)=0$


The exogeneity of the instrument criterion refers to bullet point 3 above, and an over-identified model is required to test this criterion.  The remaining 2 criteria, however, can easily be tested.  Remember that $cov(z,x)≠0$ means $z$ cannot be directly related to $y$, except through $x$.  Meaning, $z$ and $y$ are allowed to be related in bivariate relationships, but as soon as $x$ is added to the model, the relationship should be null. One easy way of testing this relationship is to fit 
$y=\beta_0+\beta_1x+\beta_2z+V\beta+\epsilon$, 
where $x$ is the endogenous variable and $V$ is a vector of exogenous control variables. Controlling for all model covariates, including the endogenous variable, test the coefficient of $z$. $\beta_z$ should be non-significant.  
Criterion 2 (also called the Test of Instrument Relevance) can be tested in a similar way but regressing $x$ on $z$ using the same control variables.
$x=\delta_0+\delta_1z+V\delta+nu$, 
The test on the coefficient of $z$ ($\delta_1$) should be statistically significant in this case.

Reference
Wooldridge JM. Introductory Econometrics: A Modern Approach. 4th ed. Mason, OH, USA: South-Western, Cengage Learning; 2009.
