Dear Jinsong, I assume from your question that X3 and X4 are also available as instruments. Then, if you use tsls() in the sem package, you could formulate the model as tsls(Y ~ X1 + X2 + X3 + X4, instruments = ~ A + B + X3 + X4, data=yourData). See ?tsls for a similar example.
It is, by the way, misleading to say that X1 "has" two instruments and that X2 "has" one instrument, in that all instrumental variables, including presumably the variables in the equation that you're taking to be exogenous, must be uncorrelated with the error. I hope this helps, John > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Jinsong Zhao > Sent: December-15-09 10:03 AM > To: r-help@r-project.org > Subject: [R] Instrumental Variables Regression > > Hi there, > > I hope to build a model Y ~ X1 + X2 + X3 + X4 with X1 has two > instrumental variable A and B, and X2 has one instrumental variable A. I > have searched the R site and mailling list, and known that the tsls() > from sem package and ivreg() from AER package can deal with instrumental > variable regression, however, I don't know how to formula the model. > > Any suggestion will be really appreciated. Thanks in advances! > > Regards, > Jinsong > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.