Introduction - If you have any usage issues, please Google them yourself
One computational method which can be used to calculate IV estimates is two-stage least squares (2SLS). In the first stage, each endogenous covariate in the equation of interest is regressed on all of the exogenous variables in the model, including both exogenous covariates in the equation of interest and the excluded instruments. The predicted values from these regressions are obtained.