In his paper titled "Using Heteroskedasticity to Identify and Estimate Mismeasured and Endogenous Regressor Models", Lewbel proposes an approach based on heteroskedasticity to create an instrument when a good candidate is not available. He also released the Stata command (ivreg2h) implementing his approach.
I am able to replicate ivreg2h output for the case in which there are no fixed effects, but not for the case in which there are fixed effects ( the case in which I am interested).
Using the example in the Stata help file:
bcuse engeldat, clearThe same output can be obtained without usingthee command by doing the following:
center age-twocars, prefix(z_)
ivreg2h foodshare z_* (lrtotexp=)
* First stage Lewbel to get residualsHowever, I am not able to replicate the FE example:
reg lrtotexp age age2 agesp agesp2 spwork s1 s2 s3 washer gasheat onecar twocars
predict r, residuals
* create the instruments
foreach var in z_age z_age2 z_agesp z_agesp2 z_spwork z_s1 z_s2 z_s3 z_washer z_gasheat z_onecar z_twocars {
gen z`var'= `var'* r
}
* Now do 2sls
ivreg foodshare z_* ( lrtotexp= zz_*)
webuse grunfeld, clearThe code I created is the following:
xtset company time
gen L1kstock = L1.kstock
gen L2kstock = L2.kstock
ivreg2h invest L1kstock L2kstock (mvalue=), fe
However, I get different results.
center L1kstock L2kstock, prefix(z_)
xtreg mvalue L1kstock L2kstock, fe
predict r, residuals
foreach var in z_L1kstock z_L2kstock {
gen z`var' = `var'* (r)
}
xtivreg invest L1kstock L2kstock (mvalue = zz_*), fe
Does anyone know what am I doing wrong?
Thanks!
Comment