On 10/08/2023 20:21, Alecos Papadopoulos wrote:
I believe this should be scripted, it is not standard two-stage least
squares.
Regress X1 on Z1 and Z2 and obtain the fitted values, say X1_f
Regress X2 on Z3 and Z4 and obtain the fitted values, X2_f
Regress Y on a constant and X1_f, X2_f, Ψ1,Ψ2.
Alecos Papadopoulos PhD
Affiliate Researcher
Dpt of Economics, Athens University of Economics and Business
Foundation for Economic and Industrial Research (IOBE)
web:
alecospapadopoulos.wordpress.com/
ORCID:0000-0003-2441-4550
On 10/8/2023 20:21, elfsog(a)yahoo.gr wrote:
> Consider the following 2SLS model:
>
> Y= b0 +b1X1+b2X2+θ1Ψ1+θ2Ψ2+e
> Where:
> Y represents the dependent variable,
> X1, X2 denote the endogenous variables,
> Ψ1,Ψ2 represent the exogenous variables.
>
> To address endogeneity in the model, a set of four instruments, is
> introduced. Two instruments (Z1 and Z2) are employed to instrument for
> X1, while two other instruments (Z3 and Z4) are used to instrument for
> X2.
> My question is: How Gretl understand which instrument stands for which
> endogenous variable?
From an econometric point of view, there is an ambiguity
in the
original post that must be resolved before explaining how to do things
in gretl, as Alecos rightly pointed out.
A common misconception in IV estimation is that a given instrument is
related to a given endogenous variable. This is by no means true in
general. Generally speaking, ALL instruments are used for ALL endogenous
variables.
Having said this, it is perfectly possible to impose constraints in the
"first-stage" regression, for example by stipulating that some of the
instruments don't enter some of the equations. But in order to do so,
you can't rely on the plain IV estimator and you have to use a different
estimator (maximum likelihood, or possibly GMM).
Here is an example on artificial data that highlights the differences
between the two approaches; for the constrained estimator, FIML is used:
<hansl>
nulldata 256
scalar a = 0.75 # amount of endogeneity
loop i = 1 .. 4
series z$i = normal()
endloop
series u1 = normal()
series u2 = normal()
series x1 = 1 + z1 + z2 + u1
series x2 = 2 + z3 + z4 + u2
series y = 3 + x1 + x2 + normal() + a * (u1 + u2)
list X = const x1 x2
list Z1 = const z1 z2
list Z2 = const z3 z4
list Z = Z1 || Z2
### ordinary IV estimation
tsls y X ; Z
### restricted IV estimation
system method=fiml
equation y X
equation x1 Z1
equation x2 Z2
endog y x1 x2
end system
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------