Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: Instrument variable


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: Instrument variable
Date   Fri, 6 Aug 2010 13:32:23 +0200

<> 

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: [email protected]
[mailto:[email protected]] Im Auftrag von Bin Dong
Gesendet: Freitag, 6. August 2010 12:14
An: [email protected]
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/


*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index