Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: AW: Instrument variable

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


You can experiment with this code:

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

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...


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Bin Dong
Gesendet: Freitag, 6. August 2010 12:14
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

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index