# Solved – Stata: Interaction effects between one endogenous regressor and two exogenous regressors

I am new to using xtivreg2 – and have a question. Sorry if this has been addressed before.

Here goes.

My question is on 2SLS regression with panel data.
I am interested in estimating an interaction effects model with one endogenous regressor (X1) and two endogenous regressors X2 and X3

Y = X1 + X1* X2 + X1* X3 + controls1

X1 is endogenous
X2 and X3 are exogenous
Controls1- set of controls to explain Y

And X1= Z+ controls2
Controls2 – set of controls to explain X1

Right now I am doing it 2SLS by hand, by predicting X1hat and sticking it in the equation for Y. I am concerned that this may not be the right way to do it.

Based on some material I have seen on Stata forums, I understand that I have to instrument X1*X2 by Z*X2.. and in essence estimate this model as a multiple endogenous regressor model.

Rajashri Srinivasan

Contents

``set more off webuse nlswork, clear  gen tenureXage = c.tenure#c.age gen tenureXhours = c.tenure#c.hours  /* OLS */ xtreg ln_w i.not_smsa c.tenure##(c.age c.hours), fe margins, dydx(tenure) at(age=30 hour=40)  /* Your Method With My First Stage */ xtreg tenure i.not_smsa i.union##(c.age c.hours), fe predict that, xbu xtreg ln_w i.not_smsa c.that##(c.age c.hours), fe margins, dydx(that) at(age=30 hour=40)  /* My Method */ xtivreg ln_w i.not_smsa c.age c.hours (tenure tenureXage tenureXhours = i.union##(c.age c.hours)), fe first nlcom ME: _b[tenure] + _b[tenureXage]*30 + _b[tenureXhours]*40 ``