Hi all,
I am trying to replicate Baltagi's example of the HT-IV. I wrote the
following small function, but do not obtain exactly his results (see
txt-file attached).
Actually, I am not so sure whether I've used the correct (transformed)
instruments.
Maybe somebody of you has already dealt with this, and may help me out.
<hansl>
open Baltagi_schooling_wage.gdt --quiet
series EXP2 = EXP_^2
# List definition
list X1 = OCC_ SOUTH_ SMSA_ IND_ #TV exogeneous
list Z1 = FEM_ BLK_ #Time-invariant exogeneous
list X2 = EXP_ EXP2 WKS_ MS_ UNION_ #TV endogenoeus
list Z2 = ED_ #TIV endogenoeus
function void xthtaylor (series Y "dependent",
list X1 "TV exog.",
list Z1 "TIV exog.",
list X2 "TV endog.",
list Z2 "TIV endog.")
# X2(i,t) are instrumented by their deviation from individual means
xbar2(i)
list X2inst = null
loop foreach i X2 -q
series dev_$i =X2.$i - pmean(X2.$i)
X2inst += dev_$i
endloop
# Z2(i) are instrumented by the individual avg of X1(i,t)
list Z2inst = null
loop foreach i X1 -q
series m_$i = pmean(X1.$i)
Z2inst += m_$i
endloop
#TSLS - Hausman-Taylor (HT)
tsls Y const X1 X2 Z1 Z2 ; const X1 X2inst Z1 Z2inst --no-tests
end function
xthtaylor(LWAGE,X1,Z1,X2,Z2)
<\hansl>