Instrumental variable methods allow consistent estimation when the explanatory variables (covariates) are correlated with the error terms of a regression relationship.
In a statistical model, a parameter or variable is said to be endogenous when there is a correlation between the parameter or variable and the error term.
Stata provides "ivreg" comand.