Dear Users,
This is my first post in Statalist. I am trying to use 2sls with a Dummy Interaction Term in unbalanced Panel Data with 183 groups and 10 years. Before going for 2sls, I ran the -xtreg, fe- command with my following equation, whereby Depvar is a continuous variable, Dummy_change is a dummy variable with value 0 (for before cahnge) and 1(for after change), Indepvar_1 is a dummy variable with value 0 (no) and 1 (yes), and Indepvar_2 is a continuous variable:
This equation gives at least two outcomes (one for 'before change' and another for 'after change') for the Indepvars (1 and 2) as interacted with Dummy_change. After that when I ran the same with -xtivreg, fe- instead of -xtreg, fe vce(cluster ID)-, it said, "no interactions are allowed as depvars". Then I searched the internet and found that I need to generate new var with interaction terms. Therefore, I generated the following interaction terms:
and ran the following command:
But the outcomes of the variables dc_iv1 dc_iv2 are shown for the whole sample, unlike -xtreg, fe- that produced two outcomes for each of the Indepvars (one for 'before change' and another for 'after change'). Please note, endogeneous variables (dc_iv1 and dc_iv2); instrumental variables (i.Dummy_change#(i.L2.Indep_1 c.L2.Indep_2) controlvars Dummy_change i.Year i.Industry); second lag of Indepvars were considered as instruments.
Could you please help me in this regard so as to get results for both 'before' and 'after' change with a single equation? I am using Stata 12.1 special edition and installed xtivreg into it.
This is my first post in Statalist. I am trying to use 2sls with a Dummy Interaction Term in unbalanced Panel Data with 183 groups and 10 years. Before going for 2sls, I ran the -xtreg, fe- command with my following equation, whereby Depvar is a continuous variable, Dummy_change is a dummy variable with value 0 (for before cahnge) and 1(for after change), Indepvar_1 is a dummy variable with value 0 (no) and 1 (yes), and Indepvar_2 is a continuous variable:
Code:
xtreg Depvar i.Dummy_change#(i.Indepvar_1 c.Indepvar_2) controlvars Dummy_change i.Year i.Industry, fe vce(cluster ID)
Code:
g dc_iv1 = Dummy_change#i.Indepvar_1
Code:
g dc_iv2 = Dummy_change#c.Indepvar_2
Code:
xtivreg Depvar (dc_iv1 dc_iv2 = i.Dummy_change#(i.L2.Indep_1 c.L2.Indep_2) controlvars Dummy_change i.Year i.Industry) controlvars Dummy_change i.Year i.Industry, fe
Could you please help me in this regard so as to get results for both 'before' and 'after' change with a single equation? I am using Stata 12.1 special edition and installed xtivreg into it.
Comment