Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Austin Nichols <austinnichols@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: AW: Instrument variable |
Date | Mon, 9 Aug 2010 12:11:09 -0400 |
Martin Weiss <martin.weiss1@gmx.de> and Bin Dong: You have to have instruments for each endog var. Generally, the endog vars will be correlated with each other, and instrumenting for one may get you nowhere: clear* set seed 123 mat c=(1,.3,.8,0,.5\.3,1,0,-.8,.5\.8,0,1,0,0\0,-.8,0,1,0\.5,.5,0,0,1) drawnorm x1 x2 instr1 instr2 error, corr(c) n(10000) clear la var x1 "Endogenous Regressor 1" la var x2 "Endogenous Regressor 2" la var instr1 "Instrument 1" la var instr2 "Instrument 2" la var error "Error" g x3=rnormal() la var x3 "Exogenous Regressor" gen y=2+2*x1-x2+1.5*x3+error reg y x? est store OLS ivregress 2sls y x3 (x1 x2 = instr1 instr2) est store corriv ivregress 2sls y x2 x3 (x1 = instr1 instr2) est store onlyone ivregress 2sls y x1 x3 (x2 = instr1 instr2) est store onlytwo di "Correct DGP: " in r "y=2+2*x1-x2+1.5*x3+error" est table OLS corriv onlyone onlytwo, label On Fri, Aug 6, 2010 at 7:32 AM, Martin Weiss <martin.weiss1@gmx.de> wrote: > > <> > > You can experiment with this code: > > ************* > clear* > set obs 10000 > mat in correls = /* > */ (1,0,.8,0,.5\0,1,0,-.6,.3\.8,0,1,0,0\0,-.6,0,1,0\.5,.3,0,0,1) > > //x1, x2 endogenous, instr1, instr2 as valid instruments > drawnorm x1 x2 instr1 instr2 error, /* > */ corr(correls) cstorage(full) clear > > la var x1 "Endogenous Regressor 1" > la var x2 "Endogenous Regressor 2" > la var instr1 "Instrument 1" > la var instr2 "Instrument 2" > la var error "Error" > > //exogenous regressor x3 > gen x3=rnormal() > la var x3 "Exogenous Regressor" > > //see correlation matrix > corr > > //DGP > gen y=2+2*x1-x2+1.5*x3+error > > //regression assuming exogeneity > reg y x? > est store OLS > > //(correct) IV regression > ivregress 2sls y x3 (x1 x2 = instr1 instr2) > est store corriv > > //instrument just one endogenous regressor (x1)? > ivregress 2sls y x2 x3 (x1 = instr1 instr2) > est store onlyone > > //or the other one (x2)? > ivregress 2sls y x1 x3 (x2 = instr1 instr2) > est store onlytwo > > //let`s compare results > di "Correct DGP: " in r "y=2+2*x1-x2+1.5*x3+error" > est table OLS corriv onlyone onlytwo, label > ************* > > As you can see, you get the correct result for the covariate that you do > instrument, and the incorrect one for the one where you do not... > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Bin Dong > Gesendet: Freitag, 6. August 2010 12:14 > An: statalist@hsphsun2.harvard.edu > Betreff: st: Instrument variable > > Dear all, > > If there are three endogenous variables in one model, do I need to > instrument all of them at once? Or can I just instrument one of the > endogenous variables? Thanks > > Cheers, > Bin * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/