R port of the Stata ivreg2 package