We define heterogeneous endogeneity as the case where a potentially endogenous regressor is endogenous for some sub-groups of the data but exogenous for other subgroups. We derive an estimator and test procedure based on the control function approach to deal with the phenomenon. We show that...